Geez, I hate to have to ask this but...
Using a search form with beginning date and ending dates as criteria.
Trying to populate 8 text boxes from the results.
In the query, I am using a Between & And statement on the date. In the other 8 fields, using a Like statement.
The query works without the Like statements but returns results on a datasheet screen - doesn't pop the fields in the form.
The query prompts for parameter on the Like statements fields if entered which of course, doesn't return anything.
Here is my query:
Is the Like statements my problem ?
Head is exploding - need help!
Using a search form with beginning date and ending dates as criteria.
Trying to populate 8 text boxes from the results.
In the query, I am using a Between & And statement on the date. In the other 8 fields, using a Like statement.
The query works without the Like statements but returns results on a datasheet screen - doesn't pop the fields in the form.
The query prompts for parameter on the Like statements fields if entered which of course, doesn't return anything.
Here is my query:
SELECT Sum(TblInvoice.miles) AS SumOfmiles, Sum(TblInvoice.partscost) AS SumOfpartscost, Sum(TblInvoice.lodging) AS SumOflodging, Sum(TblInvoice.perdiem) AS SumOfperdiem, Sum(TblInvoice.workhours) AS SumOfworkhours, ([Sumofperdiem]*45) AS Totperdiem, ([Sumofworkhours]*100) AS Totwrkhrs, ([Totperdiem]+[Totwrkhrs]+[Sumofmiles]+[Sumofpartscost]+[Sumoflodging]) AS Total
FROM TblInvoice
HAVING (((Sum(TblInvoice.miles)) Like [Forms]![FrmDates].[Qmiles] & "*") AND ((Sum(TblInvoice.partscost)) Like [Forms]![FrmDates].[Qparts] & "*") AND ((Sum(TblInvoice.lodging)) Like [Forms]![FrmDates].[Qlodge] & "*") AND ((Sum(TblInvoice.perdiem)) Like [Forms]![FrmDates].[Qperdiem] & "*") AND ((Sum(TblInvoice.workhours)) Like [Forms]![FrmDates].[Qhours] & "*") AND ((([Sumofperdiem]*45)) Like [Forms]![FrmDates].[Qperdiemcost] & "*") AND ((([Sumofworkhours]*100)) Like [Forms]![FrmDates].[Qhourcost] & "*") AND ((([Totperdiem]+[Totwrkhrs]+[Sumofmiles]+[Sumofpartscost]+[Sumoflodging])) Like [Forms]![FrmDates].[Qtotal] & "*") AND ((TblInvoice.date) Between [Forms]![FrmDates].[begdate] And [Forms]![FrmDates].[enddate]));
Is the Like statements my problem ?
Head is exploding - need help!