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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 SYSDATE)-1 TSQL ERROR

Author  Topic 

Blessed1978
Yak Posting Veteran

97 Posts

Posted - 2014-02-11 : 20:33:30


I have wrote a tsql that has multiple joins

however i keep on getting error message that sysdate is an in valid column
sys date
on this line

AND created_date > sysdate()-1
and end_date <= sysdate()

please assist

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-02-11 : 20:38:31
if you are using Microsoft SQL Server, it should be getdate()


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-02-12 : 00:29:28
quote:
Originally posted by Blessed1978



I have wrote a tsql that has multiple joins

however i keep on getting error message that sysdate is an in valid column
sys date
on this line

AND created_date > sysdate()-1
and end_date <= sysdate()

please assist


see
http://visakhm.blogspot.in/2012/12/different-ways-to-implement-date-range.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-02-12 : 11:40:35
quote:
Originally posted by khtan

if you are using Microsoft SQL Server, it should be getdate()


KH
[spoiler]Time is always against us[/spoiler]



Or the (newer) SYSTADETIME() function.

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-02-12 : 21:26:22
quote:
Originally posted by Lamprey

quote:
Originally posted by khtan

if you are using Microsoft SQL Server, it should be getdate()


KH
[spoiler]Time is always against us[/spoiler]



Or the (newer) SYSTADETIME() function.





you mean SYSDATETIME() ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -