SQL Query not working properly
Posted on 2007-10-10
I am trying to create a stored procedure that takes variables and returns the data to me.
SELECT sysdba.ACCOUNT.ACCOUNT, sysdba.HISTORY.USERNAME,
FROM sysdba.ACCOUNT INNER JOIN
sysdba.HISTORY ON sysdba.ACCOUNT.ACCOUNTID = sysdba.HISTORY.ACCOUNTID
WHERE (sysdba.ACCOUNT.ACCOUNT = @AccountName) AND (sysdba.HISTORY.LONGNOTES IS NOT NULL) AND (sysdba.HISTORY.COMPLETEDDATE = @CompDate)
sysdba.HISTORY.COMPLETEDDATE is stored in the database like so: 2007-07-19 17:48:30.000
if i try to use 7-19-2007 as the date i am searching for, is doesnt find anything, and I cant figure out how I would modify my sql so it would find the record.