473,387 Members | 1,606 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,387 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 1152
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.