uk sql date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lapchien

    uk sql date

    My query:

    SELECT DateValue([Date/time call received]) AS [Date], TimeValue([Date/time
    call received]) AS [Time], [T-cards].[Call type], [T-cards].[Sales outcome],
    [T-cards].Postcode, [T-cards].[Customer name/contact]
    FROM [T-cards]
    WHERE (((DateValue([Date/time call received])) Between [Start Date] And [End
    Date]) AND ((TimeValue([Date/time call received]))>TimeValue("0 8:00") Or
    (TimeValue([Date/time call received]))<TimeValue("1 7:00")) AND
    (([T-cards].[Call type])="Job") AND (([T-cards].[Sales outcome])="Booked"))
    ORDER BY DateValue([Date/time call received]);


    is hoping to return dates in uk format (entries between 8am and 5 pm), but
    only works if you input the us date format mm/dd/yy. Can anyone help with
    the uk date format..?

    Thanks,
    Lap


  • John Bell

    #2
    Re: uk sql date

    Hi

    Date formats can be effected by several things, including the language
    settings, use of SET DATEFORMAT etc. You may want to check out sp_configure,
    SET etc in books online.

    If you want to specify a specific date/time format in an SQL statement check
    out the CONVERT function

    John


    "Lapchien" <cc8345@nospamp lease.eclipse.c o.uk> wrote in message
    news:1068208464 .582534@ananke. eclipse.net.uk. ..[color=blue]
    > My query:
    >
    > SELECT DateValue([Date/time call received]) AS [Date],[/color]
    TimeValue([Date/time[color=blue]
    > call received]) AS [Time], [T-cards].[Call type], [T-cards].[Sales[/color]
    outcome],[color=blue]
    > [T-cards].Postcode, [T-cards].[Customer name/contact]
    > FROM [T-cards]
    > WHERE (((DateValue([Date/time call received])) Between [Start Date] And[/color]
    [End[color=blue]
    > Date]) AND ((TimeValue([Date/time call received]))>TimeValue("0 8:00") Or
    > (TimeValue([Date/time call received]))<TimeValue("1 7:00")) AND
    > (([T-cards].[Call type])="Job") AND (([T-cards].[Sales[/color]
    outcome])="Booked"))[color=blue]
    > ORDER BY DateValue([Date/time call received]);
    >
    >
    > is hoping to return dates in uk format (entries between 8am and 5 pm), but
    > only works if you input the us date format mm/dd/yy. Can anyone help with
    > the uk date format..?
    >
    > Thanks,
    > Lap
    >
    >[/color]


    Comment

    Working...