How to convert dates

  • Thread starter Thread starter Tony Girgenti
  • Start date Start date
T

Tony Girgenti

I have a form that accepts a start date and end date in the short date
format(6/19/1994). When i watch it after it is entered, it looks exactly
like the way it is keyed in with slashes and all.
I want to compare it to a field text field in an external data table which
has it's dates stored as yyyymmdd. I wrote a routine to change the entered
date to remove the slashes and format it the same way as the date in the
table.

Is there a better way to do that ? Is there a function that will convert an
entered short date to the yyyymmdd format ?

Any help appreciated.

Thanks,
Tony
 
I have a form that accepts a start date and end date in the short date
format(6/19/1994). When i watch it after it is entered, it looks exactly
like the way it is keyed in with slashes and all.
I want to compare it to a field text field in an external data table which
has it's dates stored as yyyymmdd. I wrote a routine to change the entered
date to remove the slashes and format it the same way as the date in the
table.

Is there a better way to do that ? Is there a function that will convert an
entered short date to the yyyymmdd format ?

From the immediate (debug) window:

? format$(date(),"yyyymmdd") = "20030927"
True

Is this what you're looking for?
 
That's great Bruce. I really appreciate your help.

That saved me about ten lines of coding for each date and i learned
something.

Tony
 
Back
Top