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

Formatting date to show the 1st of the month

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Feb 8, 2002
210
GB
I'm running a report based on a db2 database and i need to perform a calculation based on the first day of the month of one of the fields that i'm using. Then i need to find the number of months between this formatted date and the 1st day of the current month.

I've used this new variable to create the first day of the object month =&quot;01/&quot;+MonthNumberOfYear(<Diary Date First>)+&quot;/&quot;+Year(<Diary Date First>) - This displays fine but is a character string, so i'm unable to use the MonthsBetween function....

Anybody got an idea of how i can get around this?

[afro]

 
It's ok, panic over, have discovered the joys of the ToDate function...... All is good!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top