We help IT Professionals succeed at work.
Get Started

SQL Query (data for yesterday)

2,521 Views
Last Modified: 2015-07-31
i have a column called RentDate.

I want to get all info that happened the previous day, no matter what time it happened the previous day.

So no matter when i run the query, it need to show me the previous day info.

The query below gives me the correct info, but I know I could do something different for RentDate:

select customernbr, storenbr, toolnbr, count(toolnbr)
  from ToolsOnRent
  where RentDate '2015-07-29 22:00:21.427'
  and StoreNbr = '01101' and customernbr = '02001020'
  group by CustomerNbr, storenbr, toolnbr
Comment
Watch Question
EE Topic Advisor
CERTIFIED EXPERT
Most Valuable Expert 2014
Awarded 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 19 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE