I have the following code:
Sub GroupByDay()
SQLStr = "SELECT DISTINCTROW MeterReadings.MeterNum, " _
& "Format$([MeterReadings].[ReadDateTime],'Short Date') AS Read_time, " _
& "Max(MeterReadings.Reading) AS [Max Of Reading] " _
& "FROM MeterReadings " _
& "GROUP BY MeterReadings.MeterNum, Format$([MeterReadings].[ReadDateTime],'Short Date') " _
& "ORDER BY MeterReadings.MeterNum, Format$([MeterReadings].[ReadDateTime],'Short Date');"
DoCmd.RunSQL SQLStr
I keep getting an error telling me that my SQLStr is not a valid SQL statement. After considerable searching, I finally found that my statement is being truncated, so I am not getting the full statement. Any idea why?