473,508 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Daily Record Count

3 New Member
I am building an application that records show bookings for a resort company. They would like to have the previous 5 days as well as the current days, daily totals list automatically.

Todat - ##
Yesterday - ##
Day Before Yesterday - ##
2 days before yesterday - ##
So on and so on -##
to five days out - ##

I am thinking something with the Current date function and a repeating records function. Any help would be appreciated.
Feb 19 '07 #1
4 3109
ronverdonk
4,258 Recognized Expert Specialist
Welcome to The Scripts!

You are double posting.

Read the Posting Guidelines before you post in this forum!.

Your double thread is removed from this forum.

moderator
Feb 20 '07 #2
ronverdonk
4,258 Recognized Expert Specialist
Have a look at the MySQL date and time functiuons. What you need to accomplish your requirement are the CURRENT_DATE() and DATA_SUB() functions.

Further information can be found in the MySQL documentation at http://dev.mysql.com/doc/refman/5.1/...functions.html

Ronald :cool:
Feb 20 '07 #3
blueberries
3 New Member
That seems to work to give me a running total for 5 days... how would I use this to give me a list of daily totals. I am using PHP btw? I saw another similar question that used the group fuction am I able to group dates?
Feb 20 '07 #4
ronverdonk
4,258 Recognized Expert Specialist
Nothing to do with PHP, this is pure SQL. And indded, you must use the GROUP BY to get a total for ech group you want the totals from. So for yor query that is something like
Expand|Select|Wrap|Line Numbers
  1. SELECT date, SUM(value) AS total FROM table_name 
  2.    WHERE date BETWEEN '2007-01-10' AND '2007-01-12' 
  3.    GROUP BY date;
You can replace the specified dates with your own selections.

Ronald :cool:
Feb 20 '07 #5

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

Similar topics

6
44082
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
6
3053
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
1
1802
by: gbb0330 | last post by:
hi guys -the code (all capital letters) generates daily packing number, it is in the on click event of a command button that moves to the next record. dpkn is unbound control - i use it to...
1
5393
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
3182
by: darrel | last post by:
I'm trying to whip up a fancy repeater control that will put records into a two-column table for me. This is how I envision it working: itemtemplate if record count = odd then write out the...
13
1576
by: i. Wiin | last post by:
I've got a daily based crystal report that doesn't show 0's for days where no activity occurred. How do I get 0 values to show up in the report?
4
3074
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
11
30659
by: SKBodner | last post by:
Hello, I'm stumped and I'm hoping someone could help me figure out the best way to track daily attendance for the next 6-4 months. I have a list of 80 or so participants who should be attended...
3
1740
by: Ed Robichaud | last post by:
I'm struggling to come up with a query/report of daily attendance for records that have only start and stop dates. A x-tab (with parameters that records be within a selected date range) would...
0
7229
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
7333
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
7398
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
7502
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
5637
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,...
1
5057
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
4716
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...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.