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

Converting to a Date from a Number

Status
Not open for further replies.

NoExperienceInUtah

Technical User
Apr 30, 2003
16
US
I am using Crystal Reports with Softpro's ProForm. I have NEVER programmed before and need some help.

ProForm stores its dates in an odd format. It stores them as a number in the 20030430 format (April 30, 2003.) I am trying to create reports, but I don't want to have to teach my employees that when they are prompted for a date, they have to enter it like that. I'd like them to be able to put 04/03/2003 in the prompt and have the formula take care of the rest. I'm sure there is a formula that will take a standard date and convert it into the above formula so that it can be used with the database.

I don't know that I quite explained that right, but hopefully someone out there will understand what I need and be able to help. THANK YOU!
 
That didn't fix it either. I have a formula that works when I run it in Crystal Reports, but it doesn't pass through to the SQL Query:

WhileReadingRecords;
NumberVar input := {TrackItems.DuDt};
If input < 19590101 then Date (1959, 01, 01) else

Date ( Val (ToText (input, 0 , &quot;&quot;) [1 to 4]),
Val (ToText (input, 0 , &quot;&quot;) [5 to 6]),
Val (ToText (input, 0 , &quot;&quot;) [7 to 8]) )

I don't know if that helps.....
 
Basically nothing using a variable will pass SQL to the database.

Sorry, what I've posted works fine here, and is pretty much standard, so I can't edxplain why you can't get it to work, nor why it returns a non-related error.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top