David Perron schrieb:
Hi Sebastian-
Wanted to follow up on this. I figured out the problem. You actually
have to use the LEAST & GREATEST operators when comparing multiple
values, this statement works perfectly.
LEAST(EndDays,Q2EndDays) - GREATEST(Q2StartDays,StartDays) as DaysInQ2,
Thank
David Perron schrieb:
Hello Users-
I think I have an interesting question with regards to applying a function
to date range, I think half of problem solving is explaining it to an
audience so please, bear with me.
There is a table Orders that has two DATE columns, StartDate and EndDate.
The
Hello Users-
I think I have an interesting question with regards to applying a function
to date range, I think half of problem solving is explaining it to an
audience so please, bear with me.
There is a table Orders that has two DATE columns, StartDate and EndDate.
The range of dates can vary
> I have a report that contains a WHERE statement to report on a date
range in
> Pentaho.
>
> WHERE
> InOut.MOVEMENTDATE >= (CURRENT_DATE - 7)
>
> I want to show on the report what the first date of this range is. Can
> someone help me with this statement? So if the
I have a report that contains a WHERE statement to report on a date range in
Pentaho.
WHERE
InOut.MOVEMENTDATE >= (CURRENT_DATE - 7)
I want to show on the report what the first date of this range is. Can
someone help me with this statement? So if the last seven days is January
24, 2008
Paul,
If there are no data for a particular day, it is not included. Is
there a way to include all days even if the result is 0? I saw an
example that included another table with all dates and an inner join
but that seems a little clunky.
In SQL, enumerating data you don't have requires some
Database software is not a calendar. The data you put in is the data
you get out. If the day is never put in, you'll never get it out.
You need to have some data source that has all the days in it, like an
external table, if you want to be able to retrieve that data.
Otherwise, you could do it
I have the following query:
select count(*) as cnt, date(timestamp) as day from table where
date_sub(curdate(),interval 14 day) <= timestamp group by day;
If there are no data for a particular day, it is not included. Is
there a way to include all days even if the result is 0? I saw an
example th
Is the DATE field a timestamp column?
What's your schema? What's your primary key?
I ask this because the real question is, "is it safe to assume that
new entries are for the current day it is inserted?"
If the answer to that question is yes, you can use an id field (or an
existing one) to find
OK.
I need help with the following query:
SELECT * FROM PRODUCT WHERE DATE > ? ORDER BY PRICE;
Basically find products created since a given date and order by prices.
I could put an index of DATE, PRICE but it will have to resort to a
filesort since DATE isn't a constant value.
I was thin
James,
>I need to figure out how many Tuesdays are contained
>within 1/1/2004 - 5/1/2004, and I need to come up with
>a result where I know how many of each day of the week
>is within that date range.
Supposing a table named tbl and datetime columns named d1 and d2,
something li
Tuesdays are contained
within 1/1/2004 - 5/1/2004, and I need to come up with a result where I
know how many of each day of the week is within that date range.
I am hoping someone may have a solution, as, once I know the number of
Tues then I can state the average number of sessions on a Tuesday at
n a ready to use format with no post-processing required...
>
> I'm graphing the data from this query using dates on the x axis. The
> input to my graph module (GD::Graph) requires a constant-length list.
> So if any days in my selection range have no data, I need to fill the
&
I need to fill the
> space with an empy value.
> For example, say my date range is '2004-10-01' to '2004-10-05'
> and the query returns:
> day, amount
> 2004-10-01, 50
> 2004-10-02, 100
> 2004-10-04, 250
> I have to do some date manipulation in perl af
from this query using dates on the x axis. The
input to my graph module (GD::Graph) requires a constant-length list.
So if any days in my selection range have no data, I need to fill the
space with an empy value.
For example, say my date range is '2004-10-01' to '2004-10-05
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 14:30
Subject: Re: Date Range
> I think you are very close but you are missing the LAST day of each mont
er \(NISC\)" <[EMAIL PROTECTED]> wrote on 09/27/2004 03:18:46
PM:
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, September 27, 2004 11:40
> S
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 11:40
Subject: Re: Date Range
> To compute the date range for "two months ago". (if the curre
ROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Monday, September 27, 2004 11:40
>Subject: Re: Date Range
>
>
>> I see that you are on 4.0.18 so you can't use many of the new date
>> functions (4.1.1+) but has to be an easier way. Let's try thi
At 12:57 -0500 9/27/04, Dirk Bremer (NISC) wrote:
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Dirk Bremer (NISC)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 27, 2004 11:40
Subject: Re: Date Range
I see that you are on 4.0.18
> Whether he needs semicolons depends on which tool he is using to execute
> his statements. If he is using the MySQL client or any of several other
> tools, I agree. If he is going through an ODBC connection, he doesn't need
> them. (At least my 3.52.x drivers can't accept more than one statement
MAIL PROTECTED]>
> >Sent: Monday, September 27, 2004 11:40
> >Subject: Re: Date Range
> >
> >
> >> I see that you are on 4.0.18 so you can't use many of the new date
> >> functions (4.1.1+) but has to be an easier way. Let's try this for
Hi,
try this:
SELECT * FROM your_table
WHERE StartDate > NOW()
AND EndDate < NOW()
> Hello,
>
> I am having a problem when doing a SELECT. Here is the
> scenerio:
>
> I have a table that has an event StartDate and
> EndDate, based on the current Date "NOW()" I need to
> know which records are
SELECT * FROM table_name WHERE EndDate < now();
Is this what you need?
-Original Message-
From: Rob Sirota [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 4:12 AM
To: [EMAIL PROTECTED]
Subject: Help with SELECT statement for date range
Hello,
I am having a problem when do
On Tue, 19 Aug 2003 04:11:32 -0700 (PDT)
Rob Sirota <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am having a problem when doing a SELECT. Here is the
> scenerio:
>
> I have a table that has an event StartDate and
> EndDate, based on the current Date "NOW()" I need to
> know which records are curren
Hello,
I am having a problem when doing a SELECT. Here is the
scenerio:
I have a table that has an event StartDate and
EndDate, based on the current Date "NOW()" I need to
know which records are currently active. Can anyone
help with a quick SELECT statement?
Thanks.
=
___
Aah, I stand corrected. Friday afternoon is not my best day to be
answering questions on here. ;)
Regards,
Mike Hillyer
www.vbmysql.com
-Original Message-
From: Keith C. Ivey [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 1:59 PM
To: [EMAIL PROTECTED]
Subject: RE: Help with Date
On 6 Jun 2003 at 13:43, Mike Hillyer wrote:
> SELECT StartDate FROM Events
> WHERE 0 <= TO_DAYS(NOW()) - TO_DAYS(StartDate) <= 30;
I don't think that's doing what you think it is. In math notation <=
can be chained that way, but not in most programming languages.
0 <= x <= 30
is equivalen
On 6 Jun 2003 at 20:34, Trevor Sather wrote:
> mysql> SELECT StartDate FROM Events
> -> WHERE TO_DAYS(NOW()) - TO_DAYS(StartDate) <= 30;
> ++
> | StartDate |
> ++
> | 2004122600 |
> | 2003072100 |
> | 2003080600 |
> | 2003092600 |
> | 200305
Thanks very much (to all who replied) -- this looks good!
Best wishes
-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]
Sent: 06 June 2003 20:46
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Help with Date Range Query
At 20:34 +0100 6/6/03, Trevor Sather wrote
At 20:34 +0100 6/6/03, Trevor Sather wrote:
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from last May to December
2004...
The example probably
Because now - a future date is a negative number, and therefore < 30.
Trevor Sather wrote:
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from
()) - TO_DAYS(StartDate) <= 30;
Regards,
Mike Hillyer
www.vbmysql.com
-Original Message-
From: Trevor Sather [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: Help with Date Range Query
Hello,
Any idea why the following doesn't work?
Hello,
Any idea why the following doesn't work? It's taken from the MySQL manual
which says it should return records in the last 30 days. As you can see,
I'm getting records spanning some 19 months from last May to December
2004...
mysql> SELECT StartDate FROM Events
-> WHERE TO_DAYS(NOW())
Hi all,
I am trying to get my mysql database to be searchable
by
date, by both current and past events.
My perl program doesn't compile--- here's an excerpt--
package Date::Range;
my $range = Date::Range -> new ($date1, $date2);
error message:
--
can't locate
You may want to strongly consider converting the data to a timestamp
field type, but that's for down the road.
You want to do you search like any other range search you would do.
select * from orderheadr where orderid between "2003012400" and
"2003012499"
You're saying you want to searc
Berlin (Germany)
Tel: +49 30 7970948-0 Fax: +49 30 7970948-3
- Original Message -
From: "Chuck Barnett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 6:33 PM
Subject: question about date range
> Hi, I inherited a db that has a varch
Hi, I inherited a db that has a varchar(30) column that holds a date/time
stamp in the form of MMDDHHmmss (ex: 20030124093952)
Well I want to select a range based on the first 8 characters(MMDD).
I currently select a single day by
select * from orderheader where orderid like '$date' ;
T
torkil,
Monday, March 04, 2002, 10:57:50 AM, you wrote:
tj> I have a database table containing log files that are written by
tj> different individuals almost every day.
tj> So at any given time I want to be able to go through a web
tj> interface and get a list over logs written in any given mo
Torkil,
> I have a database table containing log files that are written by
different individuals almost every day.
>
> So at any given time I want to be able to go through a web interface
and get a list over logs written in any given month.
>
> People writing in this log also work in different de
I have a database table containing log files that are written by different individuals
almost every day.
So at any given time I want to be able to go through a web interface and get a list
over logs written in any given month.
People writing in this log also work in different department, a fie
41 matches
Mail list logo