Results 1 to 3 of 3
  1. #1
    kfschaefer is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2006
    Location
    Seattle, WA
    Posts
    5

    Dcount Syntax issue with multiple Criteria (Year(date)

    Asked by: kfschaefer1
    help with syntax: I need to determine if records exists where the quarter value = the value of (i) and the Year = current year (Year(date())

    If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter =" & Chr(34) & i & Chr(34) & "" And [Year] = Year(Date)) > 0 Then


    doesn't like the Year(date()),



    Just not seeing the issue.

    Please help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,123
    Year is a reserved word. Should avoid reserved words in naming convention.

    If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter =" & i & " And [Year] = Year(Date())") > 0 Then
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    kfschaefer is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2006
    Location
    Seattle, WA
    Posts
    5
    If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter = " & chr(34) & i & chr(34) & " And [Year] = Year(Date())") > 0 Then
    Did the trick thanks for the input.

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

Similar Threads

  1. Davg Multiple Criteria Syntax
    By JonathanT in forum Programming
    Replies: 1
    Last Post: 10-30-2013, 10:16 PM
  2. DCount with Multiple Criteria
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 05-25-2012, 09:04 AM
  3. Replies: 1
    Last Post: 05-18-2012, 11:59 AM
  4. How do you use DCOUNT for multiple criteria?
    By wwhit in forum Programming
    Replies: 5
    Last Post: 05-15-2012, 11:14 AM
  5. Replies: 4
    Last Post: 01-10-2012, 06:26 PM

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 - Senior Forums