how to convert date format
hello folks
i am new to vb. i have some columns in my table which are in "21-may-1998" format . But at my front end ( VB form) i pick it up thru a datepicker which is in " 6-23-1998" format . Can anybody plz tell me how to convert
"5/26/2005" to " 26-may-2005"
thanx in advance
Re: how to convert date format
This is a vb problem, not db.... Anyway, you probably have format options on the date picker. Look through the date pickers properties. Alternatively, you could try changing the system date format....
Re: how to convert date format
Use
Date.ToString("dd-mmm-yyyy")
Try this thing
Re: how to convert date format
Old VB/VBA
format(<datevariable>,"dd-mmm-yyyy") - read up on format function
.Net - no idea probably the same or what has been posted
Depending on the DB you may be able to format in the Sql statement. Just another possibility.
Re: how to convert date format
Quote:
Originally Posted by yogi4yu
hello folks
i am new to vb. i have some columns in my table which are in "21-may-1998" format . But at my front end ( VB form) i pick it up thru a datepicker which is in " 6-23-1998" format . Can anybody plz tell me how to convert
"5/26/2005" to " 26-may-2005"
thanx in advance
Really need to know the DB you are using.
First - there is not format of 21-may-1998 in a DB. That's a display format that a client tool is showing you. Dates are stored in a binary format - numerically.
So - again - what is the backend DB? What are you using for a provider to move data and is that in-line SQL statements or stored procedures.
Show some code with how the update is failing for you.