Need help with Calculated Access SQL syntax for selecting data within a certain period

STATUS:IIF([The_Date]<= GetDate() AND IsNull([STATUS]),"Write",[STATUS])

I have a vba module with function,


or if I could get it to work just by using SQL

Function GetDate()
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    a = GetDate
End Function

Open in new window

7601105166084Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you might set the data type to date:
Function GetDate() as Date
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    GetDate = a
End Function

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
your function's last line is wrong:
Function GetDate()
   dim a 
    a = weekday(now(),vbmonday)
    a = int(now())-a
    GetDate = a
End Function

Open in new window

0
 
7601105166084Author Commented:
Sorry you are right i re-wrote the function incorrectly [only here ((-:]  but is there anything else which seems wrong.
0
 
7601105166084Author Commented:
Thanks - i think i was using the field name too instead of an alias.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.