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!

Converting date string

Status
Not open for further replies.

VBAnewguy

MIS
Jan 28, 2003
41
US
I have a report that returns a date in the (yy,yym,mdd) format. I need this to be displayed as a normal (mm/dd/yyyy) format if possible. I think this is possible using the Date Function but I am having problems getting it to work. Any advice?
 
Assuming you've put the commas in the wrong place by accident in the first example, if your field is already a date field, you can set the date format by right-clicking the date field, and selecting Format Field. (Look under the Date/Time tab).

If it's not already a date field, you can switch a string to date using Date({YourField}), as you suggest in your post, or by doing ToText({YourField},'MM/dd/yyyy')

Naith
 
If this field is a number, use the following:

NumberToDate({YourField})

NumbertoDate() takes an 8 digit integer in a YYYYMMDD format and converts it to a real date. You may have to download this function from the Crystal Decisions website. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top