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!

date conversion

Status
Not open for further replies.

StanKorn

Technical User
Mar 28, 2002
72
0
0
US
Hi,
I need to convert a date from an SQL table datetime to an ascii numeric MMDDYY field.
When I run the query I reformat the date to read as MMDDYY by removing the separators and assigning the correct output form. My problem is I get a result that catches the space where the separator would be thus making the data 8 chr long instead of the required 6.
Can anyone help me with this task?
thanks,
stan


Remember - only dead fish go with the flow.
 
Sorry I forgot to tell you I am using SQL 2K and CR 8.5 for this task.


Remember - only dead fish go with the flow.
 
Strange... I can get it to format properly with the same setup. Try using this formula instead:

totext({Table.DateTimeField},"MMddyy")

-dave
 
When I use the TOTEXT format I get 02DDYY as a result. When I use the VAL format I get 2.00 as a result.

THe original value when I browse the data is
02/06/2004 12:00.

When I format thru CR it returns 02 06 04 as a result. The SQL table setup indicates a datetime type with 8 chr. Can this have something to do with my problem?
thanks for your help!
stan


Remember - only dead fish go with the flow.
 
Case matters. Use "MMddyy".

-LB
 
got it
thanks much


Remember - only dead fish go with the flow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top