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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to subtract 120 days from Today's date

Status
Not open for further replies.

wickyd

Technical User
Feb 14, 2002
57
ZA
Hi folx

How do you take today's date and subtract 120 days, so that I can create a column with that date?

Thank you.
 
With column of type Date: TODAY - 120
With DateTime: TODAY - 120 UNITS DAY

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
As this is the ANSI SQL forum:

CURRENT_DATE - INTERVAL '120' DAY

Dieter
 
Almost correct, the default precision for DAY intervals is 2. If you want to specify more than 2 digits, you have to specify a higher precision (up to 7), like:

CURRENT_DATE - INTERVAL '120' DAY(3)


Regards,
Jarl
 
Thank you for the help.

Unfortunately, neither of your solutions work with DBISAM.

What I did try is (CURRENT_DATE - 120), which worked.

The keyword INTERVAL is only used as COMMIT INTERVAL in the version of DBISAM I am using now.

Kind regards
wickyd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top