473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to show 7 days of info consistently in SQL?

I need to consistently show seven days of info from my database. I have script that seemed to work great until the end of the month came. I am using the Date(NOW()) function to get today, and DATE(NOW())+1 to get tomorrow and so on up to +6.

However, I guess DATE(NOW()) looks for 2010-10-32 instead of 2010-11-01. What do I have to tweak for it to work over the change of the month?

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT database.A, database.B, database.C, database.D
  3. FROM database
  4. WHERE database.A = (DATE(NOW())+1)
  5.  
  6.  
Oct 26 '10 #1
1 1363
JKing
1,206 Expert 1GB
You can use ADDDATE() or DATE_ADD(). For proper syntax please refer to MySQL Date and Time Functions
Oct 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: ben | last post by:
I'm trying to write a web client script in python to log onto a web page and pull some information off of it. The page has quite a few behind the scenes http things going on that are making it...
1
by: Devin Dow | last post by:
Framework Classes, like Point, PointF, Rectangle, etc., show nice info when you float over them or do a watch. For example, floating over a PointF shows "{X=1.0 Y=2.0}" But my classes only show...
3
by: Tom Turner | last post by:
Here's the background on my situation. The question follows --- We have 600 units of mail going from our business to various Post Offices every morning. Every unit is accompanied by a paper...
1
by: marcelo | last post by:
Hi, I have a problem when running ASP.NET projects done with VS... they only show garbage (info from HTTP headers)... Does any1 know what could be wrong? tia Marcelo
0
by: Garg | last post by:
Hi, I want to hide the rows that show days of other months in my calendar. I want my calendar to show only current month's days. The rows that appear at the bottom or top sometimes, having other...
5
by: Christina123 | last post by:
I have a database that tracks the withdrawls and returns of shared assets. I have a query that a report runs off of that is supposed to only show the most current withdrawl (based off of a yes/no...
1
by: Congcong | last post by:
When I use gprof to profile a program, it seems never show me the profile info on c lib routines such as malloc. But sometimes, profile info on such c lib routines are also important. I use 'gcc -g...
2
by: emceemic | last post by:
Is there a way to show multiple rows per row if required? For example, say the table I currently have show the following data: Impact to Business, Business Owner Name, ...
0
by: S Kajim | last post by:
Hi there, I need to calculate leap year days between two dates in PL/SQL. Will someone be able to help?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.