Question

Locked

writing access code

By dgearheart ·
I am trying to write an expression for a query in an access database that tracks the number of restricted days injured workers have during their wc claim. I have a start date and an end date, i have had success counting the days with the datediff function, however I have tried to use the if then else function for when there is no start date, no end date and when there is both start and end dates. The following is the code i tried to use. However, I get an error that states, "The expression you entered contains invalid syntax. You may have entered an operand without an operator." I think my problem is that I do not have the proper punctuation.

Rest days: if is null [Rest Duty Start Date]_ then Rest days=0 else if isnull [Rest Duty End Date] then Rest days= datediff([Rest Duty Start Date],today) else [Rest Duty Start Date],[Rest Duty End Date] end if

I would appriciate any help.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums