i am getting value in asp page in Session("SDate"). how can i change the format from asp
Main Topics
Browse All Topicshi
i am using asp and mysql. i am passing date value as a parameter and keeping the date value in session. my date format is now dd/mm/yyyy hh:mm:ss. i want to change this format and using this date i want to retrieve data from mysql
response.Write Session("SDate") i am getting the value 01/10/2009 09:00:00. but it is not giving me any value from mysql. when i am changing the date format 2009-10-01 09:00:00 then i am getting value from mysql. please can anyone tell me how i will do this.
thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> but it is not giving me any value from mysql. when i am changing the date format 2009-10-01 09:00:00 then i am getting value from mysql
Most likely you are executing something SIMILAR to:
rs.Open "SELECT * FROM TABLE where PurchaseDate='"& Session("sDate") & "'", oConn
Instead try:
rs.Open "SELECT * FROM TABLE where PurchaseDate=STR_TO_DATE('
Business Accounts
Answer for Membership
by: ushastryPosted on 2009-10-28 at 08:31:15ID: 25684369
You can change the format as(from MySQL)
str_to_date('01/10/2 009 09:00:00','%d/%m/%Y %T');