dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: SQL Server
Expertise: Beginner
Oct 8, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Parameter Setting

Question:
I need to know how to write SQL to ask for a date range and run the query on that range. Can you help me?

Answer:
I think it makes the most sense to structure your job as a procedure, then you'll at least have the benefit of declaring the @startdate and @enddate that are the case for your query.

Next, you'll need to apply the BETWEEN predicate to limit the result set; words to the effect "WHERE mydate BETWEEN(@startdate,@enddate)" should do it for you.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date