Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    1

    Unanswered: Add # around dates

    I have two times called StartTime and EndTime in my query in the format of 2:00:00AM.
    I need to pass them to a module called Time Calculation that requires the format
    ElapsedTime(#6:00:00AM#-#10:00:00PM#)
    I don't know how to get the # and - to pass it to a function from my query. Can anyone help?

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    how about this

    at the end of your first function do the folowing :

    dim x as string
    x = '(#' & StartTime & '# - #' & EndTime & '#)'

    ' then call

    ElapsedTime (x)

  3. #3
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Add # around dates

    You should consider to use the DateDiff() function! It requires datetime values as you already have, and it allows you to specify your result in seconds, minutes or whatever.

    To tranform a datetime variable into a string, you should use the format() function!
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

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