Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Team,

I have the Select Query as follows:
SQL
select count(c.ID) as [RECORDCOUNT], U.NETWORKID from CUSTOMERLOANDATA C (nolock)
Inner Join USERMASTER U (nolock) on U.Id = C.QCUSERID
where convert(varchar(10),C.UpdatedON,120) = CONVERT(VARCHAR(10), GETDATE(),120)
AND
 where isnull(c.QCPRocessed,0) = 1
group by U.NETWORKID
order by U.NETWORKID


I cant find the where condition .What does it mean ??
where convert(varchar(10),C.UpdatedON,120) = CONVERT(VARCHAR(10), GETDATE(),120)


Please Guide me.
Thanks
Harshal
Posted
Comments
Richard C Bishop 16-Apr-14 12:17pm    
What do you mean you can't find the "WHERE" condition. Look at the query, it exists where the word "WHERE" is.

1 solution

http://msdn.microsoft.com/en-us/library/ms187928.aspx[^]

Never had a reason to use SQL's "convert", but apparently it is forcing the dates into a common format (varchar) with a length of 10, "04/15/2014". This ensures that the where statement is comparing identically formatted dates.

it's selecting records that were updated on a particular day determined by the GETDATE() function and matching the dates as a 10-character string.
 
Share this answer
 
Comments
R Harshal 17-Apr-14 7:07am    
Thank you so much Bob.
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900