Professional Web Applications Themes

Dates again - ASP Database

Hello all I'm having trouble getting iis to understand the UK format of dates ASP off a MS Access database I have the following query: objRS.Open "Select CheckInitial.ID, CheckInitial.TagNo, CheckInitial.TagDate, CheckInitial.PassFail, CheckInitial.IbiD, Users.CoName From CheckInitial Inner Join Users on CheckInitial.IbId = Users.ID Where (CheckInitial.TagDate Between #" & varFirst & "# And #" & varLast & "#) And CheckInitial.IbId = " & ib & " Order by TagDate Desc" varFirst and varLast are pulled from a form input I get wrong results because the input is read as if it is US style dates not dd/mm/yy I have set the Session.LCID ...

  1. #1

    Default Dates again

    Hello all
    I'm having trouble getting iis to understand the UK format of dates

    ASP off a MS Access database

    I have the following query:
    objRS.Open "Select CheckInitial.ID, CheckInitial.TagNo,
    CheckInitial.TagDate, CheckInitial.PassFail, CheckInitial.IbiD, Users.CoName
    From CheckInitial Inner Join Users on CheckInitial.IbId = Users.ID Where
    (CheckInitial.TagDate Between #" & varFirst & "# And #" & varLast & "#) And
    CheckInitial.IbId = " & ib & " Order by TagDate Desc"

    varFirst and varLast are pulled from a form input

    I get wrong results because the input is read as if it is US style dates not
    dd/mm/yy

    I have set the Session.LCID to 2057. I have played around with CDate in
    every combination possible.
    The problem is the same on my local server (set to US settings) and the host
    server (set to UK).

    I appreciate that this type of question must have been asked many times but
    I could not find your faq page on Google

    TIA

    Clive


    Clive Moss Guest

  2. #2

    Default Re: Dates again

    Clive Moss wrote:
    > Hello all
    > I'm having trouble getting iis to understand the UK format of dates
    >
    > ASP off a MS Access database
    >
    > I have the following query:
    > objRS.Open "Select CheckInitial.ID, CheckInitial.TagNo,
    > CheckInitial.TagDate, CheckInitial.PassFail, CheckInitial.IbiD,
    > Users.CoName From CheckInitial Inner Join Users on CheckInitial.IbId
    > = Users.ID Where (CheckInitial.TagDate Between #" & varFirst & "# And
    > #" & varLast & "#) And CheckInitial.IbId = " & ib & " Order by
    > TagDate Desc"
    >
    > varFirst and varLast are pulled from a form input
    >
    > I get wrong results because the input is read as if it is US style
    > dates not dd/mm/yy
    >
    > I have set the Session.LCID to 2057. I have played around with CDate
    > in every combination possible.
    > The problem is the same on my local server (set to US settings) and
    > the host server (set to UK).
    >
    > I appreciate that this type of question must have been asked many
    > times but I could not find your faq page on Google
    >
    > TIA
    >
    > Clive
    [url]www.aspfaq.com[/url]

    in particular:
    [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    and
    [url]http://www.aspfaq.com/show.asp?id=2040[/url]

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  3. #3

    Default Re: Dates again


    "<snip>
    > > TIA
    > >
    > > Clive
    >
    > [url]www.aspfaq.com[/url]
    >
    > in particular:
    > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    > and
    > [url]http://www.aspfaq.com/show.asp?id=2040[/url]
    >
    > HTH,
    > Bob Barrows
    > --
    Thanks, Bob ,but that site is down at present - Probably why I was getting
    nowhere trying to get to it. I'll try later

    Thanks again
    Clive


    Clive Moss Guest

  4. #4

    Default Re: Dates again

    Clive Moss wrote:
    > "<snip>
    >>> TIA
    >>>
    >>> Clive
    >>
    >> [url]www.aspfaq.com[/url]
    >>
    >> in particular:
    >> [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    >> and
    >> [url]http://www.aspfaq.com/show.asp?id=2040[/url]
    >>
    >> HTH,
    >> Bob Barrows
    >> --
    > Thanks, Bob ,but that site is down at present - Probably why I was
    > getting nowhere trying to get to it. I'll try later
    >
    > Thanks again
    > Clive
    Really? It's working fine for me ...
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  5. #5

    Default Re: Dates again


    '// To US to UK / UK to US
    Function dateSwitch(yourDate)
    Dim dateArray: dateArray=Split(yourDate, "/")
    dateSwitch = dateAray(1) & "/" & dateArray(0) & "/" &
    dateArray(2)
    End Function



    On Tue, 13 Jan 2004 19:36:54 GMT, "Clive Moss"
    <cliveREMOVEinstant-image.co.uk> wrote:
    >Hello all
    >I'm having trouble getting iis to understand the UK format of dates
    >
    >ASP off a MS Access database
    >
    >I have the following query:
    >objRS.Open "Select CheckInitial.ID, CheckInitial.TagNo,
    >CheckInitial.TagDate, CheckInitial.PassFail, CheckInitial.IbiD, Users.CoName
    >From CheckInitial Inner Join Users on CheckInitial.IbId = Users.ID Where
    >(CheckInitial.TagDate Between #" & varFirst & "# And #" & varLast & "#) And
    >CheckInitial.IbId = " & ib & " Order by TagDate Desc"
    >
    >varFirst and varLast are pulled from a form input
    >
    >I get wrong results because the input is read as if it is US style dates not
    >dd/mm/yy
    >
    >I have set the Session.LCID to 2057. I have played around with CDate in
    >every combination possible.
    >The problem is the same on my local server (set to US settings) and the host
    >server (set to UK).
    >
    >I appreciate that this type of question must have been asked many times but
    >I could not find your faq page on Google
    >
    >TIA
    >
    >Clive
    >
    >
    I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

    Brynn
    [url]www.coolpier.com[/url]
    Brynn Guest

Similar Threads

  1. Between Dates
    By javman in forum Coldfusion - Advanced Techniques
    Replies: 5
    Last Post: June 7th, 02:50 PM
  2. Dates & SQL
    By smokin_joe in forum Coldfusion Database Access
    Replies: 1
    Last Post: July 29th, 04:56 PM
  3. ASP/VBS Dates Between Dates
    By Sanjay in forum Dreamweaver AppDev
    Replies: 3
    Last Post: April 28th, 06:34 PM
  4. Dates
    By Support in forum PERL Beginners
    Replies: 0
    Last Post: August 19th, 08:35 AM
  5. Help with Dates please
    By Ian Piper in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 7th, 07:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139