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

CStr Date format

Status
Not open for further replies.

skram68

IS-IT--Management
Feb 22, 2006
5
CA
I'm using CStr ({Command.INV_DATE}, 'MM/dd/yyyy') in a formula to convert a DateTime field to display as a Date without the time component.

However, on all the date fields on my report, I use format them to use the Windows default short date (so that each client can have them displayed as they want). Is there anyway I can get CStr() to format with the system date? The help screens give you all the 'string' formats, but does not reference the system format.

I'm using CR XI.

Thanks.
 
Why not just use:

date({Command.INV_DATE})

...and then you can format it to whatever display you like by going to format field->date tab.

-LB
 
I forgot to mention that the formula contains other pieces that are concatenated together to produce the final output string. So the formula field is not just the date itself.

I guess I could split it up to two formulae and then use a text field to string them back together. That way I could format the date formula field within the text field.
 
Alternately you could try:

cstr(Datevalue({Command.INV_DATE}))

this will force it to recognize the short format of your date-time field, and then allow you to reference it in your string formula

-jcrawford-

Not in word only, but in deed also... 1Jn3:18
 
Thanks Datevalue seems to do the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top