About DateTime in SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ri58776
    New Member
    • Feb 2007
    • 13

    #1

    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
  • ANR22
    New Member
    • Apr 2007
    • 2

    #2
    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(CONVE RT(CHAR(20),'Ma rch 26, 2007 05:32:08 PM',109),1,14)

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

    Comment

    Working...