Results 1 to 7 of 7
  1. #1
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34

    using "between" function within switch

    Hi,



    I'm sure the answer is staring me in the face, but I'm at a loss. I'm using the simple test expression below to assign a value of 1 to records with [saledate] between the two dates indicated in the code below and I'm just getting a null result. Can the between function not be used in this way?

    Code:
    Hughes Test: Switch([saledate] Between 1/1/2014 And 3/14/2014,1)
    Thanks,
    Andrew

  2. #2
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    ooops.. forgot he was using the function...

  3. #3
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    You probably need #'s around your dates.

  4. #4
    drewetzel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    huh? That doesn't seem to be very helpful

  5. #5
    drewetzel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    oh, just saw the second reply. they're usually added automatically, but lemme check that

  6. #6
    drewetzel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    wow....that was it. Haha, I'm so used to them being added automatically in expressions, I didn't even snap to that.

  7. #7
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    Quote Originally Posted by drewetzel View Post
    huh? That doesn't seem to be very helpful
    Yeah sorry about my first comment. At first I thought you were trying to use the C expression... I was going to mention you should use the "Select Case", but then I realized you were using the switch function.

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

Similar Threads

  1. Replies: 7
    Last Post: 08-14-2013, 03:57 PM
  2. Replies: 1
    Last Post: 04-23-2013, 08:35 AM
  3. Replies: 2
    Last Post: 11-04-2011, 02:45 AM
  4. Stuck on "Switch" expression.
    By andypandy in forum Programming
    Replies: 3
    Last Post: 07-04-2010, 05:12 PM
  5. Replies: 3
    Last Post: 04-10-2010, 10:22 AM

Tags for this Thread

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