A
Amir
Hi!
I have a table with events and dates:
Field Datatype
Event Text
EventDate Date
I have 2 variables which define a range date: MinDate and MaxDate.
I want access to check if there are Events in the range of dates according
to these variables data,
and if there is no Event in that specific range of dates, to display the
message: "There are no events in this range of dates."
How can I do that?
I thought about doing something like running a SELECT query like:
SELECT MyTable.Event, MyTable.EventDate
FROM MyTable
WHERE (MyTable.EventDate > MinDate) And (MyTable.EventDate < MaxDate);
and then make the code to check if the SELECT returns any record, but I
don't know how to check if a SELECT query doesn't give any result using
code.
In addition, I only know how to do this by saving a query in the access
database.
How can I check if an SQL SELECT sentence gives results?
How can I do this only using a code without saving a query?
Thank you very much!
Regards,
Amir.
I have a table with events and dates:
Field Datatype
Event Text
EventDate Date
I have 2 variables which define a range date: MinDate and MaxDate.
I want access to check if there are Events in the range of dates according
to these variables data,
and if there is no Event in that specific range of dates, to display the
message: "There are no events in this range of dates."
How can I do that?
I thought about doing something like running a SELECT query like:
SELECT MyTable.Event, MyTable.EventDate
FROM MyTable
WHERE (MyTable.EventDate > MinDate) And (MyTable.EventDate < MaxDate);
and then make the code to check if the SELECT returns any record, but I
don't know how to check if a SELECT query doesn't give any result using
code.
In addition, I only know how to do this by saving a query in the access
database.
How can I check if an SQL SELECT sentence gives results?
How can I do this only using a code without saving a query?
Thank you very much!
Regards,
Amir.