By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Date formatting for calculations

P: 33
Hi,

I've used a form to capture the requesters date range specifications for a set of queries forever and never cared that it took the short date entered by the requester and changed it to a number when it stored the date for later use.

Now I'm trying to subtract that number from a date supplied from a system database, which is in short date format, and the output looks like a short date instead of a number.

Can someone help me get a result that looks like the number of days between 2 dates instead of getting something that looks like a date?

Thanks,
Shawn
Jan 9 '08 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
Hi,

I've used a form to capture the requesters date range specifications for a set of queries forever and never cared that it took the short date entered by the requester and changed it to a number when it stored the date for later use.

Now I'm trying to subtract that number from a date supplied from a system database, which is in short date format, and the output looks like a short date instead of a number.

Can someone help me get a result that looks like the number of days between 2 dates instead of getting something that looks like a date?

Thanks,
Shawn
One way is to use the DateDiff function. See this link:

http://www.techonthenet.com/access/f...e/datediff.php

Dim x as integer ' number of days

x = DateDiff("d", [Date1] , [Date2])
Jan 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.