Consulting

Results 1 to 9 of 9

Thread: Solved: expression problem

  1. #1
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location

    Solved: expression problem

    THIS IS FIXED. USED NOW() INSTEAD OF DATE()

    Hi,

    Need some help please. I have a query that has a field called month. it's data type is set as date/time. in the criteria I have an expression as follows:

    between date () and date () -365

    what this had been doing is controlling a report that produces data from the current date back one year. All of sudden I am getting a message
    " undefined function 'date' in expression.
    This has been working fine until now and I have not changed anything other than to input data. Does anyone have any idea what might be going on here?
    Correction, we did upgrade the operating system to Windows XP Professional.

    Thanks in advance

    GaryB
    Last edited by GaryB; 11-17-2004 at 10:19 AM. Reason: FIXED

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Gary,
    Try Now() instead of Date()
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    I did, and it only responds to 4 months worth of data instead of 12 months as before.

    Thanks



    Gary

  4. #4
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    boy do I feel really stupid! When I said now didn't work I had forgotten that I was working on an old copy of the database and that I only had data for that many months. Now () did work on the real database.

    Thanks

    Gary

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Glad it worked out.
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    BoardCoder
    Licensed Coder VBAX Expert mark007's Avatar
    Joined
    May 2004
    Location
    Leeds, UK
    Posts
    622
    Location
    Hi Gary, check out the mark solved option under thread tools for solved threads
    "Computers are useless. They can only give you answers." - Pablo Picasso
    Mark Rowlinson FIA | The Code Net

  7. #7
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    i must be blind - didn't find the tool your refering to

    G

  8. #8
    BoardCoder
    Licensed Coder VBAX Expert mark007's Avatar
    Joined
    May 2004
    Location
    Leeds, UK
    Posts
    622
    Location
    Hi Gary,

    When you view the thread just above the first post are:

    Thread Tools Search this Thread Rate Thread Display Modes

    Under Thread Tools shoukd be the option 'Mark Solved', select this and hit 'Perform Action'.

    "Computers are useless. They can only give you answers." - Pablo Picasso
    Mark Rowlinson FIA | The Code Net

  9. #9
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    found it

    thanks

Posting Permissions

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