If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date syntax in query
I get an error message with the following sql statement. It
does not seem to like the format "short date". Could someone check the syntax for me and see where I've gone astray? sSQL = "TRANSFORM Sum(qryBillingSummary.Hrs) AS SumOfHrs " _ & "SELECT qryBillingSummary.Name, qryBillingSummary.MedRecNum, " _ & "qryBillingSummary.AdmitDate, qryBillingSummary.Diagnosis, " _ & "qryBillingSummary.PlanName " _ & "FROM qryBillingSummary " _ & "WHERE qryBillingSummary.AdmitDate between bdate and edate " _ & "GROUP BY qryBillingSummary.Name, qryBillingSummary.MedRecNum, " _ & "qryBillingSummary.AdmitDate, qryBillingSummary.Diagnosis, " _ & "qryBillingSummary.PlanName " _ & "PIVOT Format([AdmitDate],"short date")" Thank you in advance! Ginger |
#2
|
|||
|
|||
Date syntax in query
You would need to use
PIVOT Format([AdmitDate], 'Short Date')" I question where bdate and edate are coming from... -- Duane Hookom MS Access MVP "Ginger" wrote in message ... I get an error message with the following sql statement. It does not seem to like the format "short date". Could someone check the syntax for me and see where I've gone astray? sSQL = "TRANSFORM Sum(qryBillingSummary.Hrs) AS SumOfHrs " _ & "SELECT qryBillingSummary.Name, qryBillingSummary.MedRecNum, " _ & "qryBillingSummary.AdmitDate, qryBillingSummary.Diagnosis, " _ & "qryBillingSummary.PlanName " _ & "FROM qryBillingSummary " _ & "WHERE qryBillingSummary.AdmitDate between bdate and edate " _ & "GROUP BY qryBillingSummary.Name, qryBillingSummary.MedRecNum, " _ & "qryBillingSummary.AdmitDate, qryBillingSummary.Diagnosis, " _ & "qryBillingSummary.PlanName " _ & "PIVOT Format([AdmitDate],"short date")" Thank you in advance! Ginger |
Thread Tools | |
Display Modes | |
|
|