sql query in C# syntax

Posted by Malli0403 under C# on 4/3/2013 | Points: 10 | Views : 875 | Status : [Member] | Replies : 4
hello
how to pass the time query between different times.....




Responses

Posted by: Jayakumars on: 4/3/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

try this

select getdate()

Mark as Answer if its helpful to you

Malli0403, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 4/3/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
try this Query

declare @strlen varchar(50)
declare @strDate varchar(50)
DECLARE @TotTime varchar(40)
SET @strlen=len(getdate())-1
SET @strDate=getdate()
SET @TotTime =substring(@strDate,12,8)
SELECT @strDate
--SELECT @strlen
SELECT @TotTime

Mark as Answer if its helpful to you

Malli0403, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Malli0403 on: 4/3/2013 [Member] Starter | Points: 25

Up
0
Down
i am looking for time not for date..


Malli0403, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 4/3/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

use this 2 different Time

Firs-1
=========
SELECT convert(VARCHAR(8),getdate(),108)

Second
===============
SELECT convert(Time,getdate(),108)

Mark as Answer if its helpful to you

Malli0403, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response