Saturday, February 11, 2012

About DateTime in SQL

Hi,
I am making a report in SQL Reporting with the following format.
Does any have any idea how can I get date in this format "Monday, March 26, 2007" and how can I get time of each tranction in Reporting.I tried Formatdatetime function but it doesn't work..Plzz help me Thanks

Monday, March 26, 2007
10am 100
10am 110
1pm 100
Total: 310
Tuesday,March 27,2007
11am 500
6 pm 500
Total: 1000
Grad Total 1310

Quote:

Originally Posted by ri58776

Hi,
I am making a report in SQL Reporting with the following format.
Does any have any idea how can I get date in this format "Monday, March 26, 2007" and how can I get time of each tranction in Reporting.I tried Formatdatetime function but it doesn't work..Plzz help me Thanks

Monday, March 26, 2007
10am 100
10am 110
1pm 100
Total: 310
Tuesday,March 27,2007
11am 500
6 pm 500
Total: 1000
Grad Total 1310


----
For Date format you can use....Example,

SELECT substring(CONVERT(CHAR(20),'March 26, 2007 05:32:08 PM',109),1,14)

For Time part... Example
SELECT CONVERT(CHAR(15),'05:32:08 PM',114)

No comments:

Post a Comment