Converting date value to US format

B

Bogdan Zamfir

Hi,

I use an Access BE, and I need to use an update SQL query to update a
datetime field
In my locale date format is dd/mm/yy, but in Access SQL date must bhe
formatted as mm/dd/yy in order to be able to update database, as follows

Update Project set EndDate = "01/31/03" where ProjectID = 100

So I have to convert my date 31 january 2003 to US format (mm/dd/yy)

How can I accomplish this?

I knowe I can use myDateVar.GetDateTimeFormats(...), but I don't know what
parameter should I use to specify the format

Thank you

Bogdan
 
M

Michal A. Valasek

| So I have to convert my date 31 january 2003 to US format (mm/dd/yy)
|
| How can I accomplish this?

For example:

Dim MyDate as DateTime = DateTime.Now()
Dim MyString as String = MyDate.ToString("yyyy\/MM\/dd")
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top