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!

String to Date?

Status
Not open for further replies.

JRandallC

Technical User
Sep 17, 2002
10
0
0
US
Hopefully this will be a simple question. I am working on a report in Impromptu 7. I have a field that I have pieced together with inserted text and text from another field. This field resembeles a date in mm/dd/yyyy format. How can I convert this field from a string to a date? I need to use this field in a calculation in my filter. I need to pull records where this newly created date is <= today's date. Any help in this is greatly appreciated. Thanks.

Randall
 
I think the string needs to be YYYYMMDD. Then you can use
string-to-number and finally use number-to-date. Once it's a date, you can format how you'd like and compare to today's date.
 
Randall

Here is the Equation in Impromptu date example is &quot;02/10/2002&quot;, fieldname called stringDate

10th Feb 2002

numbertodate((10000*(StringtoInteger(right(Stringdate,4))+ (1000 * (StringtoInteger(left(Stringdate,2))+ StringtoInteger(substring(stringdate,4,2)

I may have the wrong no of bracjets but the Impromptu equation editor should work it out for you.

Cheers

Tony Goldsmith














 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top