D
David Pelizzari
I am attempting to query a table based on two parameters from a form, I have
a date field and a site field. I would like to have the user be able to
input one or the other, or both and query the data. Without any additional
code, I can specify just the date and get all site data back. Here is my
current query code:
SELECT dbo_ISD_Lease.*, dbo_ISD_Lease.epend_dt,
dbo_ISD_Lease.epasset_status, dbo_ISD_Lease.[rStatus*], dbo_ISD_Lease.rSite,
dbo_ISD_Lease.rSite
FROM dbo_ISD_Lease
WHERE (((dbo_ISD_Lease.epend_dt) Like [Forms]![Parameters]![StartDate]) AND
((dbo_ISD_Lease.epasset_status)="Active") AND ((dbo_ISD_Lease.rSite) Like
[Forms]![Parameters]![Site Code] & "*"));
I was thinking I could use an If Else statement, or nested iif, but I got
lost in the code...
a date field and a site field. I would like to have the user be able to
input one or the other, or both and query the data. Without any additional
code, I can specify just the date and get all site data back. Here is my
current query code:
SELECT dbo_ISD_Lease.*, dbo_ISD_Lease.epend_dt,
dbo_ISD_Lease.epasset_status, dbo_ISD_Lease.[rStatus*], dbo_ISD_Lease.rSite,
dbo_ISD_Lease.rSite
FROM dbo_ISD_Lease
WHERE (((dbo_ISD_Lease.epend_dt) Like [Forms]![Parameters]![StartDate]) AND
((dbo_ISD_Lease.epasset_status)="Active") AND ((dbo_ISD_Lease.rSite) Like
[Forms]![Parameters]![Site Code] & "*"));
I was thinking I could use an If Else statement, or nested iif, but I got
lost in the code...