Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare Dates With Current Date

Status
Not open for further replies.

barim

Technical User
May 10, 2021
2
0
0
US
Hello,

I would like to compare Projection_Date and Invoice Date to Current_Date, and if Projection Date and Invoice Date are less then Current Date it should be "I", other wise "A".

Thank you in advance.
 
Code:
CASE WHEN Projection_Date < Current_Date THEN 'I' ELSE 'A' END

Borislav Borissov
VFP9 SP2, SQL Server
 
barim,
Do you keep the [tt]Current_Date[/tt] as a field in your table? I hope not...
Then Borislav's code would be:
Code:
CASE WHEN Projection_Date < [blue]CAST(GETDATE() AS Date)[/blue] THEN 'I' ELSE 'A' END

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Sorry for the late response, I really thank you for helping me. It works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top