473,421 Members | 1,736 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,421 software developers and data experts.

reports based on date...

64
Hi developpers,
I need to generate reports in three ways:

I have a Date field in my database...

today
$query = 'SELECT * FROM 'table' WHERE Date = today';

Past seven days
$query = 'SELECT * FROM 'table' WHERE Date - 7';

Choose month( drop down preferably)

$query = 'SELECT * FROM 'table' WHERE Date = "'.$_POST['monthselected'].'"';

Please help on how to do the SQLs based on date
Jul 25 '07 #1
1 1155
dafodil
392 256MB
Hi developpers,
I need to generate reports in three ways:

I have a Date field in my database...

today
$query = 'SELECT * FROM 'table' WHERE Date = today';

Past seven days
$query = 'SELECT * FROM 'table' WHERE Date - 7';

Choose month( drop down preferably)

$query = 'SELECT * FROM 'table' WHERE Date = "'.$_POST['monthselected'].'"';

Please help on how to do the SQLs based on date
You can use the functions in this link: http://dev.mysql.com/doc/refman/5.0/...functions.html


There are also examples.
Hope you'll learn a lot.

If you got any questions feel free to post.
Jul 25 '07 #2

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

Similar topics

1
by: rk | last post by:
Hi, I'm trying to write a cgi/perl programs to post a report like the following format in which the the user has to feed the values(nos) in the boxes under % Done Qual Rel. Stab P1 p2 P3.......
7
by: SharkSYA | last post by:
After canvassing ideas it appears that the way I need to do it is not possible.There are 126 rooms, more to be added, and it needs to print a report or reports showing 76 days of bookings. There...
0
by: neoteny2 | last post by:
I need MS Access to automatically create reports/subreports based on specific criteria. I am building a database in Access 2003 with different locations/sites. I have the "sites" table created...
0
by: ZRexRider | last post by:
Hi, I've written reports based on stored procedures that receive parameters and it usually seems straight forward. Today I would like to use Crystal Reports parameter interface t prompt for a...
1
by: access baby | last post by:
Hi Below mention is the reply from Salad on my query i created a crosstab query and form not based on any table of qurey but this doesnt work . I somehow have missed something actually i have too...
3
by: seryozha | last post by:
Hello once again, Now I have a "simple" question. When creating a report based off of a query (a query that asks for a date range using the Between, And, function) How would you show the date...
4
by: stpark22 | last post by:
Hello, I'm building a tracking tool using Access 2003, where my users will be entering orders that includes quantity of products sold, and cost per unit. I'm in the process of building several...
1
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am brand new to using Crystal Reports and am trying to generate a report based on a custom object - in another project. I have a layered design, with all my business objects in a seperate...
3
by: mode67 | last post by:
I have one button printing 5 reports base on a Query with one criteria. It works BUT THE PROBLEM: I have to put in the date for each report so it will print. I want to put the date in once and...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.