ferryjenny
Technical User
Hi
I am trying to write an SQL statment that uses a DSum function however it seems to be having trouble interpreting the quotes I am using the SQL is
"SELECT Message.Time, Message.Amount, Message.[Free Text] AS Sender, "&_
"DSum('[Amount]','[Message]','[Time]<= #' & DateAdd('h',-2,[Time]) & '# And [Type ID] = 'cp'') AS Population "&_
"FROM Message "&_
"WHERE [Message]![Type ID]='cp'"
I think the problem is caused because I have 2 single quotes at the end of the DSum line but I have tried double quotes and they dont work
Any help would be very much appreciated
I am trying to write an SQL statment that uses a DSum function however it seems to be having trouble interpreting the quotes I am using the SQL is
"SELECT Message.Time, Message.Amount, Message.[Free Text] AS Sender, "&_
"DSum('[Amount]','[Message]','[Time]<= #' & DateAdd('h',-2,[Time]) & '# And [Type ID] = 'cp'') AS Population "&_
"FROM Message "&_
"WHERE [Message]![Type ID]='cp'"
I think the problem is caused because I have 2 single quotes at the end of the DSum line but I have tried double quotes and they dont work
Any help would be very much appreciated