Expression in a Query without Actual Fields (1 Viewer)

Lilly420

Registered User.
Local time
Today, 17:05
Joined
Oct 4, 2013
Messages
126
Hello,

I wasn't sure if this was possible and I did try but could not figure it out.

I need to figure out the amount of days between two dates that do not exist in my database...I use this calculation to do waivers...I was able to build a table and put in the two dates and then build a query which calculates the days between the two but I wanted to know if I could build a query that prompts on a [start date] which I would enter and then prompts on an end date [end date] which I would enter to get the number of days between...is that possible?

I had...

WaiverDays: [Enter start date]-[Enter end date] but it did not let me run...I added () and it still did not run...

I thank you for any help.

Lilly
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:05
Joined
Aug 30, 2003
Messages
36,128
Not a method I would use, but I got it to work with dates by wrapping each prompt in the CDate() function.
 

Lilly420

Registered User.
Local time
Today, 17:05
Joined
Oct 4, 2013
Messages
126
Thank you...I could not get it to work and I know I am not doing this right...could you show me by example please?

WaiverDays: CDate([Enter start date]-[Enter end date])

I thank you for helping me.

Lilly
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:05
Joined
Aug 30, 2003
Messages
36,128
Well, I said each prompt:

WaiverDays: CDate([Enter start date])-CDate([Enter end date])
 

Lilly420

Registered User.
Local time
Today, 17:05
Joined
Oct 4, 2013
Messages
126
Thank you so much...funny thing is it still wouldn't run until I added a table into the query...funny...

You did say that and I tried using it in both places but had my () in the wrong place so I apologize for that ... I don't write a lot of expressions so it is always a learning experience for me and I thank you for taking the time to help me.

You have a great day.

Lilly
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:05
Joined
Aug 30, 2003
Messages
36,128
No worries Lilly, and have a great day yourself!
 

Users who are viewing this thread

Top Bottom