Topics | Search Log Out | Register | Edit Profile
Hide Clipart | Banned/Unbanned User Log | Moderator Login History | Thread Delete/Move Log | Last 30 mins | 1 | 2
SQL Server gootle kochen ....Date format

Chalanachithram.com DB » New TF Industry Related » Archive through August 28, 2015 » SQL Server gootle kochen ....Date format « Previous Next »
Author Message
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14153
Registered: 02-2009
Posted From: 166.137.246.128

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:52 pm:       

Gagu

Then what is ur expecting based on ur FP
I gotta know given two dates finding diff in hours minutes and seconds
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Humpty_dumpty
Moderator
Username: Humpty_dumpty

Post Number: 31271
Registered: 02-2009

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:50 pm:       


Driverramudu:

Note while creating that function change Database name to your database
U might get exception as I used mine


uthamudu ayina gopi letter
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54776
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:49 pm:       


Driverramudu:

U might get exception as I used mine


LOL..but not 100% what I expected...but will play around with it
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14152
Registered: 02-2009
Posted From: 166.137.246.128

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:48 pm:       

Mental Miya
Don't give hints to gagu
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Mental_sachinodu
Hero
Username: Mental_sachinodu

Post Number: 17622
Registered: 10-2008
Posted From: 209.60.166.146

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:34 pm:       


Driverramudu:

Note while creating that function change Database name to your database
U might get exception as I used mine




answer fafer cofy kotte appudu peru kooda cofy kottevaadi la kanavaduthunnaaad kadha Guvvesh neeku :D
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14151
Registered: 02-2009
Posted From: 166.137.8.64

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:28 pm:       

Gagu

Note while creating that function change Database name to your database
U might get exception as I used mine :D
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14150
Registered: 02-2009
Posted From: 166.137.8.64

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:26 pm:       

Gagu
Chk ur mail
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54775
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:15 pm:       


Sooridu:


just book marked it...chaala options already try chesaa...veella ki excel lo elaa vasthundhoo alaane kaavalanta...so trying other options
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54774
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:13 pm:       


Driverramudu:

   
Gagu


rakesh.ccdb@gmail.com
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14149
Registered: 02-2009
Posted From: 166.137.8.64

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:09 pm:       

Gagu

I got it your requirement

For that u need to write custom function as I said :-)

Gimme some time I would send function to you
What is ur mail id
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54773
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 03:01 pm:       


Maverick:

use select with case stmt


how?
 

Sooridu
Junior Artist
Username: Sooridu

Post Number: 424
Registered: 10-2012
Posted From: 198.234.106.18

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:59 pm:       

annai ee link naaku eppudu bookmark lo untaadhi... emanna use aytaadeemo soodandi...

http://www.sql-server-helper.com/tips/date-formats.aspx
 

Maverick
Legend
Username: Maverick

Post Number: 57990
Registered: 01-2008
Posted From: 108.171.130.188

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:50 pm:       


Gandhiguevara:


use select with case stmt
Happy Vizag
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14147
Registered: 02-2009
Posted From: 166.137.8.64

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:49 pm:       

Gagu

How no way

We used extensively that we never had any issue
Otherwise u might be using wrong way I.e later date first and earlier date next you should use

Otherwise if the hours between two dates are beyond 23 then it will not work

Then we need to create scalar function
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54772
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:42 pm:       


Driverramudu:

Select convert(varchar(10),@date2-@Date1,108)


driver kaaka I tried that before....kaani BS results vasthunnay


Bharat:

select RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) / 60)),2)
+ ':' +
RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) % 60)), 2)


some extent work ayyindhi gaani more than 100 hours difference vunte first digit stripoff aipothaandhi... like difference 198:54 vundhi anuko...98:54 sooyisthondhi...

Hours part lo 2 ni 3 chesthe...aaa 3 digit diff baane vundhi gaani 2 digit hours 013:25 avuthunnayi...malli less than 10 hour differece baane vundhi

RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) / 60)),3)
 

Bharat
Junior Artist
Username: Bharat

Post Number: 555
Registered: 06-2015
Posted From: 199.90.60.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:25 pm:       


Driverramudu:

Select convert(varchar(10),@date2-@Date1,108)




This answer is better.
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54771
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:23 pm:       


Emc2:

date formattting ki $250/hr


Big data project ani theeskunnaru...vachaaka excel files ichi load cheyyamannaaru...chesthunnaa....naa gundem adindhi
 

Driverramudu
Hero
Username: Driverramudu

Post Number: 14143
Registered: 02-2009
Posted From: 166.137.8.64

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:23 pm:       

Concatenate with zeros and use right function to extract 2 characters

Very silly one amma more over bettet one is u can use below function

Select convert(varchar(10),@date2-@Date1,108)
Driving is my PASSION.
Ball or Bimmer does not matter.
 

Bharat
Junior Artist
Username: Bharat

Post Number: 554
Registered: 06-2015
Posted From: 199.90.60.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:22 pm:       


Emc2:

$250/hr



 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54769
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:22 pm:       


Bharat:

select RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) / 60)),2)
+ ':' +
RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) % 60)), 2)




SQL lo right ane function vundhaa...worked like a charm


Thanks Bhayya...oka roju Modi ni thittanu
 

Emc2
Legend
Username: Emc2

Post Number: 44099
Registered: 03-2008
Posted From: 108.48.4.24

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:21 pm:       

date formattting ki $250/hr


em company babu, naku kuda oka job chudu


 

Bharat
Junior Artist
Username: Bharat

Post Number: 553
Registered: 06-2015
Posted From: 199.90.60.4

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:18 pm:       

select RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) / 60)),2)
+ ':' +
RIGHT('0' + convert(varchar(30), (datediff(mi, @startDate, @endDate) % 60)), 2)
 

Gandhiguevara
Legend
Username: Gandhiguevara

Post Number: 54768
Registered: 10-2009
Posted From: 204.61.207.7

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, August 27, 2015 - 02:09 pm:       

declare @startDate datetime
declare @endDate datetime
set @startDate = '2011-12-22 15:20:00.000'
set @endDate = '2011-12-22 18:23:09.000'

select convert(varchar(30), (datediff(mi, @startDate, @endDate) / 60))
+ ':' +
convert(varchar(30), (datediff(mi, @startDate, @endDate) % 60))



result 3:3 ani vasthaandhi....naaku 03:03 kaaavali....how?


result

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x8b5f58c){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

  A   B   C   D   E   F   G   H   I   J   K   L   M  

N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: