Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Correct Query Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a table with 2 time fields

    strInspTime, Text, 6 char

    dtmInspTime, Date/Time, Short Time

    strInspTime contains four digits time as hhmm

    0830
    1245
    1645

    I can

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Correct Query Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Strings such as 0830 and 1245 are interpreted by Windows as whole numbers and hence as dates (the number of days since December 30, 1899), at midnight (0:00 AM).
    To convert to time, use for example

    SET qrytblBPReqInsp.dtmInspTime = TimeSerial(Left(([strInspTime],2),Right(([strInspTime],2),0)

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Correct Query Syntax? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    After further review I see I asked the same question on 04/19/03

    For others reveiwing this thread I had to remove 2 extra ( as follows:

    SET qrytblBPReqInsp.dtmInspTime = TimeSerial(Left([strInspTime],2),Right([strInspTime],2),0)

    Thanks, John

Posting Permissions

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