CRecordset and SQL problem
-
Hi I have a SQL question that looks something like this: "SELECT DISTINCTROW Table1.strDate AS strDateEx, Sum(Table1.dfValue) AS dfValueEx FROM Table1 GROUP BY Table1.strDate;" What i want to do is that i have a table with dates. And i want one row for each day with the sum for that day in the dfValueEx column. I have no problem on getting the question to work when i try it in Access. My problem is that i don't know how i could make this work in a CRecordset. When i try i get a "Invalid character value for cast specification on column number 1 (strDate)" error. What does this error mean, and how can i get this to work?
-
Hi I have a SQL question that looks something like this: "SELECT DISTINCTROW Table1.strDate AS strDateEx, Sum(Table1.dfValue) AS dfValueEx FROM Table1 GROUP BY Table1.strDate;" What i want to do is that i have a table with dates. And i want one row for each day with the sum for that day in the dfValueEx column. I have no problem on getting the question to work when i try it in Access. My problem is that i don't know how i could make this work in a CRecordset. When i try i get a "Invalid character value for cast specification on column number 1 (strDate)" error. What does this error mean, and how can i get this to work?
Strange, a few minutes after i posted the question i got a step further. As it is now i have all my dates as strings in the database, and tried to use RFX_Text to bind a CString to that column to get the value. It seems that the result of a Table1.strDate AS strDateEx is a Date/Time column, at least i think it is. Becuase when i used RFX_Date i didn't get the error that i got previous. But instead i get "Error retrieving record.". So i still have some problems and could really need som help.