Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to convert Datefield to Date with time zone

Author  Topic 

NikishaDevi
Starting Member

4 Posts

Posted - 2014-07-04 : 13:08:17
I have passed createdDate from UI to Stored procedure.createdDate field declared with DateTime.it is having value 2014-07-01.I need to fetch records from the database based upon the created field.but Create_TM in database having value Date with timestamp.so how would i change the createdfield in stored procedure.
ALTER PROCEDURE [dbo].[ByDateRange]

@Feed VARCHAR(50),

@CreatedDate DATETIME

select * from Date_table where Create_TM = @CreatedDate

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2014-07-04 : 15:23:28
select *
from Date_table
where Create_TM >= @CreatedDate and Create_TM < dateadd(day,1,@CreatedDate)


Too old to Rock'n'Roll too young to die.
Go to Top of Page
   

- Advertisement -