Geeks With Blogs

News



Add to Google

Tim Hibbard CEO for EnGraph software

I would like to blog more about the problems I encounter on a daily basis.  I find that taking 10 minutes or so to write a simple solution to my problems helps me retain that information.

I always forget the specific syntax to declaring variables in T-SQL. 

declare @startdate datetime;
declare @enddate datetime;
 
set @startdate = '04/01/2010';
set @enddate = '04/30/2010';
 
select count(id) from triphistory where tripdate between @startdate and @enddate
Posted on Monday, June 7, 2010 9:46 AM | Back to top


Comments on this post: Declaring variables in SQL

# re: Declaring variables in SQL
Requesting Gravatar...
Thanks for writing that out. I end up doing quick google searches for the SQL syntax I need...to have these organized somehow would be great.
Roxanne@stretching routine
Left by Roxanne on Aug 14, 2011 10:30 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Hibbard | Powered by: GeeksWithBlogs.net