0

hi.

how can i convert string format to datetime:

the string is formatted like : December 01, 2010 (which is another table) tblTransactions
and the datetime column format is : 2010-12-01 (another table) tblBilling

how can i search my string format to my table which matches the column (datetime field).

Thank You.

3
Contributors
4
Replies
13
Views
3 Years
Discussion Span
Last Post by newbie26
1
SELECT somefield FROM tblTransactions WHERE somedatetimecolumn = STR_TO_DATE('$stringdate','%M %d, %Y');

Assuming you're using PHP - $stringdate and MySQL. You don't give much info, do you?

0

hi..sorry..i was not able to say..im using SQL Server 2005.
Thank You.

0

hey i found the solution..

SELECT convert(datetime, @somestringcolumn) from tblTransactions

Thanks..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.