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

Parameter Value in IIF

P: n/a
I need to make a parameter query that will use an invoice aging date as
one of the parameters. So if the user picks an aging date of 10/31/03,
the query will pick all the open invoices <= the invoice date.

I was thinking about seperating out the over 30, 60 and 90 days columns
with IIF statements. Would this be possible to compare a given parameter
value in a IIF? Help/Example appreciated. Thanks.

Frank
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Something like this

PARAMETERS [What Invoice Date?] Date;
SELECT CustomerID, OrderID,
IIF(InvoiceDate - Date() Between 30 and 59, Due) As Over30,
IIF(InvoiceDate - Date() Between 60 and 79, Due) As Over60,
IIF(InvoiceDate - Date() > 79, Due) As Over90
FROM Invoices
WHERE InvoiceDate >= [What Invoice Date?]
AND Due - Paid > 0.0

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBP9/LpoechKqOuFEgEQLwRgCgzfOVqpL/xnOeMs3eCBBJZSsL0JUAnAky
UWw7sQD25P2pcI1E69FWiyJl
=L4uA
-----END PGP SIGNATURE-----

Frank Py wrote:
I need to make a parameter query that will use an invoice aging date as
one of the parameters. So if the user picks an aging date of 10/31/03,
the query will pick all the open invoices <= the invoice date.

I was thinking about seperating out the over 30, 60 and 90 days columns
with IIF statements. Would this be possible to compare a given parameter
value in a IIF? Help/Example appreciated. Thanks.

Frank
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #2

P: n/a
Thanks for the great example.

Sincerely,
Frank

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.