Results 1 to 3 of 3
  1. #1
    reidn is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jun 2011
    Posts
    37

    Between formatting

    I have a form where you select a month to see records from. This would not be a problem accept for the date/time is recorded as


    MM/DD/YYYY 00:00:00 AM. I am trying to write a between statement that looks like this...

    WHERE QA_Packaging.Date Between "[forms!Scores!MonthConv]/1/[forms!scores!Year] 00:00:00 AM" And "[forms!Scores!MonthConv]/31/[forms!scores!Year] 11:59:59 AM";

    The MonthConv is a textbox that converts the month selected to a number, 1, 2, 3 etc... and Year is the year selected. Am I formatting it wrong?

    Thanks in advance for the help

  2. #2
    vicrauch is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Sacramento
    Posts
    27
    If you are dealing with dates, rather than using the double quotes you have shown here, you need to have the hash symbol on each side of a date.
    "[forms!Scores!MonthConv]/1/[forms!scores!Year] 00:00:00 AM" should be:
    "#" & Forms!Scores!MonthConv & "/1/" & Forms!scores!Year & " 00:00:00 AM#"

  3. #3
    reidn is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jun 2011
    Posts
    37
    I tried that and its response was "This expression is typed incorrectly or it is too complex to be evaluated". I know the rest of the SQL is correct...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Conditional formatting
    By avarusbrightfyre in forum Forms
    Replies: 3
    Last Post: 07-01-2011, 11:18 AM
  2. formatting in Access
    By yiyi in forum Access
    Replies: 8
    Last Post: 11-19-2010, 03:54 PM
  3. Chart formatting
    By NISMOJim in forum Access
    Replies: 0
    Last Post: 07-31-2010, 08:52 PM
  4. Conditional Formatting
    By DanOzDirect in forum Reports
    Replies: 3
    Last Post: 07-21-2010, 08:49 PM
  5. HELP! formatting currency
    By jgelpi16 in forum Reports
    Replies: 1
    Last Post: 07-06-2010, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums