Link to home
Start Free TrialLog in
Avatar of 7601105166084
7601105166084Flag for United Kingdom of Great Britain and Northern Ireland

asked on

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

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

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

Avatar of 7601105166084

ASKER

Sorry you are right i re-wrote the function incorrectly [only here ((-:]  but is there anything else which seems wrong.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks - i think i was using the field name too instead of an alias.