Help, newbie creating a formula in a query!!!

sunshine

New Member
Joined
May 27, 2003
Messages
32
Hi All

Hope someone can help. I have a created a simple database using a tutorial. It is based on a library database. I am using a formula to calculate the number of days that a book has been borrowed.

I am using the following formula in the query:
DaysOnLoan: [DateReturned]-[DateBorrowed]

when I run the query, I get the prompt for paramater dialog box where I enter the date borrowed. When I enter the date I get a #error message in my open query. The only way I had any kind of success was when I entered the date in all numbers with no spaces. The result of that was I got a result something like -272757!

I thought that maybe it was because I was not using the same date format as the tables but that did not work either.

I'm sure that the problem is something little that I am overlooking or not doing correctly. I would appreciate any feedback.

Thanks!
Sunshine
:confused:
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
If it's asking for a parameter, then either DateBorrowed isn't in your table, or you've spelt the field name wrong. Have a check and make sure the spelling is OK.
 
Upvote 0
In one word ***DUH I am not really an idiot!

Thank you so much! now it works perfectly. I thought I did check but I had a space where I was not supposed to and a letter in lower case that should be in upper case.

I love this site! I knew I would get the answer!

Thanks again!
Sunshine :biggrin: :biggrin: :biggrin:
 
Upvote 0
:LOL:

For future reference, case shouldn't matter and it's always best to use field names without any spaces or special characters- avoids problems down the line.
 
Upvote 0

Forum statistics

Threads
1,221,537
Messages
6,160,400
Members
451,645
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top