Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    139

    Unanswered: Query w/Expression needs to be # field

    I have set up a field in a query (ElapsedTime: Format(Int((DateDiff("n",[beg time],[end time]))))that gives me the date/time difference in minutes. The problem I am now having is that I have created another query that takes the ElapsedTime field from the original query and I set the total line option to sum. It give me a warning box thta says "Data type mismatch in criteria expression". I think the field data type needs to be a number field but since I created the field in a query, I do not know how to set it up as a number.

    I am trying to equate the difference in the beg time and end time in one field and then I will need to take that data and sum it by the part number. Should I go about this differently or can someone tell me how to set the elapsedtime field to number.

    Appreciate any help,
    B&R

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Drop the "Format()" peice. Int() will give you what you want, format turns it back into a string.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Feb 2004
    Posts
    139
    Brillant Teddy! It works perfectly.

    Thanks,
    B&R

Posting Permissions

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