Quick Interval Date Calculation

A

Adam

I'm trying to check on an interval basis (ex: every 2 weeks) up to a specific
end date on a field I cally "ByWhenDate". I tried date serial but its not
working or maybe I'n not using it right.

I want to run a query that tells me person a has a due date (bywhendate) 2
months from now, but i want to check every 2 weeks up until that date. Any
suggestions?
 
M

MGFoster

Adam said:
I'm trying to check on an interval basis (ex: every 2 weeks) up to a specific
end date on a field I cally "ByWhenDate". I tried date serial but its not
working or maybe I'n not using it right.

I want to run a query that tells me person a has a due date (bywhendate) 2
months from now, but i want to check every 2 weeks up until that date. Any
suggestions?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To "to check every 2 weeks" you'll have to run the query every 2 weeks.

The query would have a WHERE clause like this:

WHERE DateAdd("m", 2, Date()) <= ByWhenDate

This compares the ByWhenDate to today's date plus 2 months. If the
ByWhenDate is within 2 months of today's date the query will return the
row data for whatever you have in the SELECT clause.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSRZ5ooechKqOuFEgEQJ8DwCgqTwVN5y2evfWffBG1FoeyrlS7C0An3s2
Uffbnqohi0NWYNTXxNyq/Lmh
=u6vZ
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top