Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting on date (AccessXP)

    Hi. I am having trouble selecting all the payments for the last 6 months. The Payment date is a string field (formatted as dd/mm/yy).
    I format this as format(PayDate, "yyyymmdd"), and then run a query to select all PayDate >= "20060723"). This used to work fine, however, now I am getting the error "Overflow". It seems to only happen for the last few payments (ie payments made this year).

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

    Re: Selecting on date (AccessXP)

    Why is PayDate a string field? It should be a date field, you can then easily perform calculations with it.

  3. #3
    Lounger
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting on date (AccessXP)

    I have changed it to a date/time field, and then I select using PaymentDate >=DateAdd("m",-6,Date()). However, now I get the message "Data Type mismatch in criteria expression".

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

    Re: Selecting on date (AccessXP)

    Rather confusing. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

Posting Permissions

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