"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Saturday, April 16, 2011

No of records entered in day by a user in sql server.

Hi *.*,
It sounds grt na. :) but actiually its a simple logic.

SELECT COUNT(*) From [Tablebname]where [CreatedDate]=GetDate() and [UserName]=@UserName;



Here:
[Tablebname]--> Table Name
[CreatedDate] --> Column name In table where date is stored in datetime Type
[UserName] --> Column name In table where Username is stored.

Hope u got it.If any trouble ask me.
Stay tune...
Have a nice day... 'N happy Coding :)

No comments: