SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Sever 2005
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

onkabetse
Starting Member

Botswana
5 Posts

Posted - 04/20/2011 :  13:46:13  Show Profile  Reply with Quote
I am working on a school project on sql server 2005. I then have to validate orderdate column to accept a date which is not greater than current date.

I tried to use the following syntax but did not work;;

orderdate<date()
orderdate<Now()
orderdate<=Date()

Help me on how I can validate the field..

ajthepoolman
Constraint Violating Yak Guru

USA
384 Posts

Posted - 04/20/2011 :  13:50:13  Show Profile  Reply with Quote
To get the current date use GETDATE() instead of Now().

Hey, it compiles.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000