Help with query

W

wizof103

I have two fields I would like to use in a form per a query. The fields
are
RequestDate and POIssued. The Requestdate is a date field and the
POIssued is
a Yea/No field. I would like to setup a query that will show all
records that
have not been issued a PO 30 days past the Request date. So if a
request was
recorded on 6/23/05 and I run this form on 7/25/05 this record would
show up,
and remind me I have to create a PO for this request. Thanks in
Advance.

I recieve the following string to place in the criteria line on the
query,

SELECT RequestDate, POIssued
FROM table
WHERE Not POIssued
AND DateAdd("d", 30, RequestDate) < Date()

When I do I recieve the following error.

"The expression you entered has an invalid.(dot) or !
operator or invalid parentheses. You may have entered an invalid
idenitifer
or typed parentheses following the Null constant.
Any help in resolving this. Thank you in advance.
 
G

George Nicholson

I recieve the following string to place in the criteria line on the
query,

SELECT RequestDate, POIssued
FROM table
WHERE Not POIssued
AND DateAdd("d", 30, RequestDate) < Date()

No, that doesn't go on the Criteria line. Here are 2 ways to do it:

1) - Create a new, blank query
- View> SQL View
- Paste all of the above in (changing "table" name?)
- Run

2) - Create a new, blank query
- Add your table
- Add the 2 fields
- POISssued Criteria line: False
- RequestDate Criteria line: < DateAdd("d", -30, Date())
- Run

HTH,
 
J

John Vinson

I tried it both ways and received a "Undefinded function 'Date' in
expression?

This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.

John W. Vinson[MVP]
 

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