Link to home
Create AccountLog in
Avatar of Sourceminer
SourceminerFlag for United States of America

asked on

MySQL DateAdd Function

I know MSSQL but seems that mySQL is not liking some syntax I need help with the Date Add Function here is the query below what am I doing wrong with the the DateADD fucntion in this syntax?


SELECT
agentactivity.AgentFirstName,
agentactivity.AgentLastName,
Count(call.WorkgroupCall) AS TotalCalls,
agentactivity.WorkgroupName,
call.DialedNumber
FROM
`agentactivity`
Inner Join `queuecall` ON agentactivity.QueueCallID = queuecall.ID
Inner Join `connect` ON queuecall.ConnectTableID = connect.ID
Inner Join `call` ON call.ID = connect.CallTableID
Inner Join `calltype` ON call.CallType = calltype.CallType
WHERE
call.StartTime <  DATE_ADD(day, -10, NOW())
GROUP BY
agentactivity.AgentFirstName,
agentactivity.AgentLastName
ORDER BY
TotalCalls DESC

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Sourceminer

ASKER

Sweet, I looked at the online document prior to my asking the question, seems I was just missing the "Interval" key word, good to know about the shortcut.
Thank you for the Fast Reply!