Ask a Question related to ASP, Design and Development.

  1. #1

    Default Dates and databases

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

    YYYYMMDD hh:mm:ss





    grw Guest

  2. Similar Questions and Discussions

    1. Between Dates
      I am trying to query an online access database and return records that have occurred between dates. I am using another query which does work to...
    2. Dates & SQL
      In my CF form I have created a date object using #DateFormat(Now(),"MM/DD/YY")# which displays the date as: 07/29/05. When the date is inserted...
    3. 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:...
    4. Federated Databases, joins across databases etc
      Greetings, I want to do a join between 2 tables on 2 different db2 databases on the same server. I assume that I have to use federated databases. I...
    5. Help with Dates please
      Hi, In a SQL table I have a field named departure and a date in inserted in it. What is the exact syntax to get only records with a future date...
  3. #2

    Default Dates and Databases

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

    Inserting into an Access database using the above script generates this
    error :
    Microsoft JET Database Engine error '80040e07'
    Syntax error in date in query expression '#20031021 20:36#'.

    Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....

    If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?

    If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this valid
    in all situations, or am I doing something wrong in the first step?

    Cheers!





    grw Guest

  4. #3

    Default Re: Dates and databases

    Sorry - quick fingers, ignore this one

    "grw" <none@none.com> wrote in message
    news:uIbHSY6lDHA.3504@TK2MSFTNGP11.phx.gbl...
    > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    >
    > YYYYMMDD hh:mm:ss
    >
    >
    >
    >
    >

    grw Guest

  5. #4

    Default Re: Dates and Databases

    I would use YYYY/MM/DD

    I have used that with both Access/Jet, and SQL Server with plenty of
    success.

    Cheers
    Ken

    "grw" <none@none.com> wrote in message
    news:OGh4Jb6lDHA.2528@TK2MSFTNGP10.phx.gbl...
    : [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    :
    : Inserting into an Access database using the above script generates this
    : error :
    : Microsoft JET Database Engine error '80040e07'
    : Syntax error in date in query expression '#20031021 20:36#'.
    :
    : Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....
    :
    : If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?
    :
    : If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this valid
    : in all situations, or am I doing something wrong in the first step?
    :
    : Cheers!
    :
    :
    :
    :
    :


    Ken Schaefer Guest

  6. #5

    Default Re: Dates and Databases

    "grw" <none@none.com> wrote in message
    news:OGh4Jb6lDHA.2528@TK2MSFTNGP10.phx.gbl...
    > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    >
    > Inserting into an Access database using the above script generates this
    > error :
    > Microsoft JET Database Engine error '80040e07'
    > Syntax error in date in query expression '#20031021 20:36#'.
    >
    > Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....
    >
    > If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?
    >
    > If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this valid
    > in all situations, or am I doing something wrong in the first step?
    I have not tried this myself, but if you include the "time designator"
    character (as specified in ISO 8601), will it work then?

    Basic: YYYYMMDDThhmmss
    Ex - 20031021T100900

    Extended: YYYY-MM-DDThh:mm:ss
    Ex - 2003-10-21T10:09:00

    Regards,
    Peter Foti


    Peter Foti Guest

  7. #6

    Default Re: Dates and Databases

    Tried both methods and similar errors unfortunately Peter.


    "Peter Foti" <peterf@systolicnetworks.com> wrote in message
    news:vpafs5qo0qlm53@corp.supernews.com...
    > "grw" <none@none.com> wrote in message
    > news:OGh4Jb6lDHA.2528@TK2MSFTNGP10.phx.gbl...
    > > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    > >
    > > Inserting into an Access database using the above script generates this
    > > error :
    > > Microsoft JET Database Engine error '80040e07'
    > > Syntax error in date in query expression '#20031021 20:36#'.
    > >
    > > Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....
    > >
    > > If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?
    > >
    > > If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this
    valid
    > > in all situations, or am I doing something wrong in the first step?
    >
    > I have not tried this myself, but if you include the "time designator"
    > character (as specified in ISO 8601), will it work then?
    >
    > Basic: YYYYMMDDThhmmss
    > Ex - 20031021T100900
    >
    > Extended: YYYY-MM-DDThh:mm:ss
    > Ex - 2003-10-21T10:09:00
    >
    > Regards,
    > Peter Foti
    >
    >

    grw Guest

  8. #7

    Default Re: Dates and Databases

    grw wrote:
    > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    >
    > Inserting into an Access database using the above script generates
    > this error :
    > Microsoft JET Database Engine error '80040e07'
    > Syntax error in date in query expression '#20031021 20:36#'.
    >
    > Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....
    >
    > If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?
    >
    > If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this
    > valid in all situations, or am I doing something wrong in the first
    > step?
    >
    > Cheers!
    Access, actually Jet, uses non-standard language in its JetSQL. For example,
    using # to delimit dates is non-standard. The format required for dates is
    also non-standard. If you believe the online help, then the only acceptable
    format for dates is US format: m/d/yyyy. However, we have discovered that it
    will also handle dates in yyyy-mm-dd and yyyy/mm/dd formats. The ISO
    standard format that you attempted to use is unfortuantely not handled.

    For your specific purpose, JetSQL has access to many VBA functions,
    including Date(), Now(), and Time(), so you do not need to concatenate the
    values from those functions into your SQL statements. You can use the
    function calls themselves:

    Update UsersTable SET UpdateTime=Now()

    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

  9. #8

    Default Re: Dates and Databases

    Interesting thanks Bob
    I guess, apart from the delimiters, this would upscale to SQL just as well.


    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:eCbh9y#lDHA.1884@TK2MSFTNGP09.phx.gbl...
    > grw wrote:
    > > [url]http://www.aspfaq.com/show.asp?id=2260[/url]
    > >
    > > Inserting into an Access database using the above script generates
    > > this error :
    > > Microsoft JET Database Engine error '80040e07'
    > > Syntax error in date in query expression '#20031021 20:36#'.
    > >
    > > Using SQL : UsersTable SET UpdateTime=#"& dbDate(Now())&"# .....
    > >
    > > If YYYYMMDD hh:mm:ss is a universal date, why is it rejecting it?
    > >
    > > If I change it to YYYY/MM/DD hh:mm:ss it then becomes valid. Is this
    > > valid in all situations, or am I doing something wrong in the first
    > > step?
    > >
    > > Cheers!
    >
    > Access, actually Jet, uses non-standard language in its JetSQL. For
    example,
    > using # to delimit dates is non-standard. The format required for dates is
    > also non-standard. If you believe the online help, then the only
    acceptable
    > format for dates is US format: m/d/yyyy. However, we have discovered that
    it
    > will also handle dates in yyyy-mm-dd and yyyy/mm/dd formats. The ISO
    > standard format that you attempted to use is unfortuantely not handled.
    >
    > For your specific purpose, JetSQL has access to many VBA functions,
    > including Date(), Now(), and Time(), so you do not need to concatenate the
    > values from those functions into your SQL statements. You can use the
    > function calls themselves:
    >
    > Update UsersTable SET UpdateTime=Now()
    >
    > 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.
    >
    >

    grw Guest

Posting Permissions

  • You may not post new threads
  • You may 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