D
DavidW
I have a form where the user can enter a start date and an end date
into two textboxes. The default for both textboxes is today's date.
The user can then view or print a report of transactions between those
two dates. I would like for the default to be the current day's
transactions.
The report will not pick up any transactions from a table if the dates
entered are the same date. If the dates are different, it will get the
transactions. For example, a txtStartDate of 8/29/2006 and a txtEndDate
of 8/29/2006 will not pick up any data. A txtStartDate of 8/28/2006 and
a txtEndDate of 8/29/2006 will get the transactions.
Here is my query:
SELECT Transactions.*, Hoods.*
FROM Hoods INNER JOIN Transactions ON
[Hoods].[ID]=[Transactions].[BoxID]
WHERE ([Transactions].[TDate] Between
[Forms]![DateQuery].[txtStartDate] And
[Forms]![DateQuery].[txtEndDate])
ORDER BY [Transactions].[TDate];
The report displaying the transactions is based on the query.
I'm almost certain that the reason for my problem is that the dates
are formatted as long in the table - 8/29/2006 11:13:00 AM. What would
be the easiest solution? If I format the start and end dates on my form
as long, I will need to use a default of today's date at 12:00 am for
the start date. How would I do that? I could also reformat the date in
the query so it will do an accurate search. What is the best way to do
that? Another option would be to change the date format in the
transaction table. I would rather not change it.
Thanks for any help.
into two textboxes. The default for both textboxes is today's date.
The user can then view or print a report of transactions between those
two dates. I would like for the default to be the current day's
transactions.
The report will not pick up any transactions from a table if the dates
entered are the same date. If the dates are different, it will get the
transactions. For example, a txtStartDate of 8/29/2006 and a txtEndDate
of 8/29/2006 will not pick up any data. A txtStartDate of 8/28/2006 and
a txtEndDate of 8/29/2006 will get the transactions.
Here is my query:
SELECT Transactions.*, Hoods.*
FROM Hoods INNER JOIN Transactions ON
[Hoods].[ID]=[Transactions].[BoxID]
WHERE ([Transactions].[TDate] Between
[Forms]![DateQuery].[txtStartDate] And
[Forms]![DateQuery].[txtEndDate])
ORDER BY [Transactions].[TDate];
The report displaying the transactions is based on the query.
I'm almost certain that the reason for my problem is that the dates
are formatted as long in the table - 8/29/2006 11:13:00 AM. What would
be the easiest solution? If I format the start and end dates on my form
as long, I will need to use a default of today's date at 12:00 am for
the start date. How would I do that? I could also reformat the date in
the query so it will do an accurate search. What is the best way to do
that? Another option would be to change the date format in the
transaction table. I would rather not change it.
Thanks for any help.