How do I handle this date?

N

needin4mation

Hi, I have a database that requires dates in this format:

30-sep-2006

The ODBC driver does not convert. In 1.1 I either parsed the date and
put it in the right format or used a validator on the client side
explaining how to submit the date.

I haven't written anything big in 2.0 and don't want to start
incorrectly. How would you handle the date here? Is it the same as
1.1? Is there some "new" way to do it? The regular user here would
enter the date normally as 09/30/2006. thank you for any advice.
 
N

Nathan Sokalski

I would save it in a Date variable and then use the ToString() method with a
format parameter to output it in whatever format you want. If necessary, you
can also specify the format the date is in when saving it to the Date
variable. For more information, see the documentation on creating and
formatting dates.
 
M

Mark Rae

Hi, I have a database that requires dates in this format:

30-sep-2006

The ODBC driver does not convert. In 1.1 I either parsed the date and
put it in the right format or used a validator on the client side
explaining how to submit the date.

I haven't written anything big in 2.0 and don't want to start
incorrectly. How would you handle the date here? Is it the same as
1.1? Is there some "new" way to do it? The regular user here would
enter the date normally as 09/30/2006. thank you for any advice.

Firstly, you should not allow your users to enter dates in a potentially
ambiguous way. E,g, you might see today's date as 10/02/2006 - to me, that
says 10th February... However, you are at least trying to convert the user
entry into an unambiguous format, so that's not quite so bad...

As for how you do this, there's really not much difference between v1.x and
v2...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,096
Latest member
ThurmanCre

Latest Threads

Top