Is there any determined date for mysql 6 release?

2008-01-19 Thread legolas
Hi Thank you for reading my post Is there any scheduled date mysql 6 release? I heard that it is based on falcon and can perform better... Thanks. -- View this message in context: http://www.nabble.com/Is-there-any-determined-date-for-mysql-6-release--tp14968233p14968233.html Sent from

MySQL SELECT Statement with Date help request

2008-01-09 Thread Cx Cx
Hi List, I am wondering if someone can help me with a query to check what databases are on the MySQL server and then check which of those databases are either partially or completely within the date range i require. The scenario is as follows: db1 : 2007-01-01 to 2007-02-01 db2 : 2007-02-01

Re: MySQL SELECT Statement with Date help request

2008-01-09 Thread Brent Baisley
am wondering if someone can help me with a query to check what databases are on the MySQL server and then check which of those databases are either partially or completely within the date range i require. The scenario is as follows: db1 : 2007-01-01 to 2007-02-01 db2 : 2007-02-01 to 2007-03

MySQL5.1 estimated release date?

2007-12-21 Thread js
Hi, A silly question. Is there anybody knowing estimated GA release date for MySQL 5.1? I heard it was planed to be released in december this year and the latest release 5.1.22 is RC, but seems that it will not happen soon. Thanks. -- MySQL General Mailing List For list archives: http

Re: Weird behavior with date(null) and if

2007-12-14 Thread Daniel Mikic
Baron Schwartz schrieb: On Dec 13, 2007 4:18 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Baron Schwartz wrote: Hi, On Dec 13, 2007 3:53 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Hi, i hit a weird behavior: select date(null); #result is null select if(date(null) is null, 1, 2

Weird behavior with date(null) and if

2007-12-13 Thread Daniel Mikic
Hi, i hit a weird behavior: select date(null); #result is null select if(date(null) is null, 1, 2); #result is 2 (not null) select if(date(null) is not null, 1, 2); #result is 1 I use mysql version 5.0.32-Debian_7etch1-log. Is this a bug and if not, can anyone explain why? Thanks, Daniel

Re: Weird behavior with date(null) and if

2007-12-13 Thread Baron Schwartz
Hi, On Dec 13, 2007 3:53 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Hi, i hit a weird behavior: select date(null); #result is null select if(date(null) is null, 1, 2); #result is 2 (not null) select if(date(null) is not null, 1, 2); #result is 1 I use mysql version 5.0.32-Debian_7etch1-log

Re: Weird behavior with date(null) and if

2007-12-13 Thread Daniel Mikic
Baron Schwartz wrote: Hi, On Dec 13, 2007 3:53 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Hi, i hit a weird behavior: select date(null); #result is null select if(date(null) is null, 1, 2); #result is 2 (not null) select if(date(null) is not null, 1, 2); #result is 1 I use mysql version

Re: Weird behavior with date(null) and if

2007-12-13 Thread Baron Schwartz
On Dec 13, 2007 4:18 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Baron Schwartz wrote: Hi, On Dec 13, 2007 3:53 PM, Daniel Mikic [EMAIL PROTECTED] wrote: Hi, i hit a weird behavior: select date(null); #result is null select if(date(null) is null, 1, 2); #result is 2 (not null) select

How to emulate a DATE() in MySQL 4.0?

2007-11-03 Thread mikesz
Hello mysql, I have a PHP script that I have written and it runs beautifully on current MySQL and PHP sites BUT, it barfs on MySQL 4.0 because I am using the DATE() to extract the Date from a timestamp. Does anyone remember how to do an equivalent function in 4.0? I have searched through hundreds

Re: How to emulate a DATE() in MySQL 4.0?

2007-11-03 Thread Baron Schwartz
[EMAIL PROTECTED] wrote: Hello mysql, I have a PHP script that I have written and it runs beautifully on current MySQL and PHP sites BUT, it barfs on MySQL 4.0 because I am using the DATE() to extract the Date from a timestamp. Does anyone remember how to do an equivalent function in 4.0? I

Using MySQL date/time

2007-10-08 Thread Tiago Cruz
Hello guys, I would like to get some registers on my database that are older than 90 days, and after delete it because the table is very larger: mysql select count(*) from max_ecardsent; +--+ | count(*) | +--+ | 1172330 | +--+ 1 row in set (0.01 sec) But I'm confusing

date query

2007-08-14 Thread Christian High
I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may or may not be taken everyday. I need to develop a query that will subtract the scale reading on one day from the scale reading on the next

Re: date query

2007-08-14 Thread Baron Schwartz
Hi, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may or may not be taken everyday. I need to develop a query that will subtract the scale reading on one day from

Re: date query

2007-08-14 Thread Christian High
On 8/14/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may or may not be taken everyday. I need to develop

Re: date query

2007-08-14 Thread Jason Pruim
On Aug 14, 2007, at 8:38 AM, Christian High wrote: On 8/14/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may

Re: date query

2007-08-14 Thread Baron Schwartz
Hi, Christian High wrote: On 8/14/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may or may not be taken everyday. I

Re: date query

2007-08-14 Thread Christian High
On 8/14/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Christian High wrote: On 8/14/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007

Re: date query

2007-08-14 Thread Shawn Green
Hi Christian, Christian High wrote: I have a table that includes a date and a scale reading like datescale_reading 2007-08-01 150 2007-08-02 125 these reading may or may not be taken everyday. I need to develop a query that will subtract the scale reading on one

Re: Selecting rows by DATE ranges

2007-06-25 Thread Jørn Dahl-Stamnes
On Monday 25 June 2007 10:32, Mogens Melander wrote: Looks like you have datetime fields makeing 2007-01-01 00:00:01 2007-01-01. Or use SELECT ... WHERE CONVERT(date,DATE)2007-01-01... if 'date' is a DATETIME field. Also using BETWEEN on date-ranges might help. On Sun, June 24

Re: Selecting rows by DATE ranges

2007-06-25 Thread Mogens Melander
Looks like you have datetime fields makeing 2007-01-01 00:00:01 2007-01-01. Also using BETWEEN on date-ranges might help. On Sun, June 24, 2007 02:13, Miguel Cardenas wrote: Hello list I found a little problem with an application am developing, in particular creating reports by DATE

Re: Selecting rows by DATE ranges

2007-06-24 Thread Pintér Tibor
date(), date_format() t Miguel Cardenas írta: Hello list I found a little problem with an application am developing, in particular creating reports by DATE ranges. Examples: select ... where date2007-01-01; returns all records where date is greater (and equal inclusive) to 2007-01-01

Selecting rows by DATE ranges

2007-06-23 Thread Miguel Cardenas
Hello list I found a little problem with an application am developing, in particular creating reports by DATE ranges. Examples: select ... where date2007-01-01; returns all records where date is greater (and equal inclusive) to 2007-01-01 select ... where date=2007-01-01; returns all records

date function question

2007-06-12 Thread Andrey Dmitriev
Can someone advise the best way to determine a) the # of days since the first of the month from last month (e.g. from 5/1/07) b) the # of days since the end of last month (e.g. from 5/31/07) Is there are a good way to determine the # of workdays in a month. Thanks, Andrey -- MySQL General

Re: date function question

2007-06-12 Thread Peter Brawley
# of days since the first of the month from last month datediff(now(),date(concat(period_add(date_format(now(),'%Y%m'),-1),'01'))) the # of days since the end of last month (e.g. from 5/31/07) datediff(now(),date_sub(concat(date_format(now(),'%Y-%m-'),'01'),INTERVAL 1 DAY)) PB

Re: date function question

2007-06-12 Thread Baron Schwartz
There is also a LAST_DAY() function that returns the last day of the month: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Peter Brawley wrote: # of days since the first of the month from last month datediff(now(),date(concat(period_add(date_format(now(),'%Y%m'),-1),'01

5.1 release date

2007-05-22 Thread Olaf Stein
Hi all, Are there any projections as to when mysql 5.1 will be released? Thanks Olaf -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

a function to convert a uk date to and from mysql date

2007-05-22 Thread ross
Hi, My UK dates are this format DD/MM/ I want it reversed and then the seperator changed so it becomes -MM-DD I use this PHP at the moment $available_from = implode('/', array_reverse(explode('-', $available_from))); Ta, R.

Re: a function to convert a uk date to and from mysql date

2007-05-22 Thread Chris Boget
My UK dates are this format DD/MM/ I want it reversed and then the seperator changed so it becomes -MM-DD I use this PHP at the moment $available_from = implode('/', array_reverse(explode('-', $available_from))); An even better solution would be: $UKDate = '22/05/2007' $USDate = date

RE: a function to convert a uk date to and from mysql date

2007-05-22 Thread Edward Kay
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 22 May 2007 15:47 To: mysql@lists.mysql.com Subject: a function to convert a uk date to and from mysql date Hi, My UK dates are this format DD/MM/ I want it reversed and then the seperator changed

RE: Help With a Week ( date ) query

2007-04-02 Thread Jerry Schwartz
The first part of the WHERE clause gives you the week number of a record's date, and compare it with today's week number. Note that WEEK(2008-01-01,7) will return 53, indicating that because 2008-01-01 is a Tuesday it is part of the last week of 2007. That, I think, is what you want. The second

Help With a Week ( date ) query

2007-03-29 Thread Joey
the record that has the date 3/26/2007. Basically we are returning a special which is dated each Monday, any day within that week should show the Monday value. I appreciate your help! Joey -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

RE: Help With a Week ( date ) query

2007-03-29 Thread Jerry Schwartz
I'm not sure if this gets you all the way, or not. There is a WEEK() function that converts a date into its week of the year. There isn't any obvious way to turn it back into a date, but it doesn't sound like you need it for your particular application. SELECT * FROM specials WHERE WEEK(NOW(), 7

RE: Help With a Week ( date ) query

2007-03-29 Thread Jim Ginn
Jerry: We do this exactly at: http://www.WeeklyRentals.com Jim I'm not sure if this gets you all the way, or not. There is a WEEK() function that converts a date into its week of the year. There isn't any obvious way to turn it back into a date, but it doesn't sound like you need

Date format question

2007-01-15 Thread Olaf Stein
Hi All Is it possible in mysql to create a date field that stores year and month only (-MM) without having to zero out the day or use varchar type fields Thanks Olaf -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com

Re: Date format question

2007-01-15 Thread Chris White
Is it possible in mysql to create a date field that stores year and month only (-MM) without having to zero out the day or use varchar type fields Best here is to just use a DATE field, then use DATE_FORMAT when you want to pull up the customized date. It will get stored as a timestamp

Re: Date format question

2007-01-15 Thread Olaf Stein
Thanks... My issue is not storage, it is confidentiality. I am not allowed to store the day of birth as it is considered identifying information (in medical records). I do not even have the day, I want to pass a date in format (-MM) to a date field if possible. On 1/15/07 11:37 AM, Chris

Re: Date format question

2007-01-15 Thread Gerald L. Clark
Olaf Stein wrote: Thanks... My issue is not storage, it is confidentiality. I am not allowed to store the day of birth as it is considered identifying information (in medical records). I do not even have the day, I want to pass a date in format (-MM) to a date field if possible. Pass

Re: Date format question

2007-01-15 Thread Robert Gehrig
Assign all dates to have a day of 01 Store in a date field, use DATE_FORMAT to just extract the MM and . As you don't have the real day information it doesn't matter what day is used, so long as it present in all months. Hope this helps Robert Gehrig Webmaster at www.gdbarri.com e-mail

Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
OK, thank you. How is the speed of this index compared with an indexed date column if I do: year_number='x' and month_number='y' and day_number='z'; They should have about the same cardinality, right? Thanks, Anders Chris wrote: Anders Lundgren wrote: One potential solution might

Re: Date v. DateTime index performance

2007-01-10 Thread Brent Baisley
, you'll need to add an OR statement, which will slow things down. If you want to search on just year and month for a date field, just add the first day of the month. If you want an entire month, search on = first day of the month and the first day of the next month. That will use an index

Re: Date v. DateTime index performance

2007-01-10 Thread Anders Lundgren
the second half of each year from 2000 on. To include 2/2002, you'll need to add an OR statement, which will slow things down. If you want to search on just year and month for a date field, just add the first day of the month. If you want an entire month, search on = first day of the month

Re: Date v. DateTime index performance

2007-01-09 Thread Anders Lundgren
, Anders Dan Buettner wrote: Thomas, I do not think in this case that one is better than the other, for the most part, because both require using a value computed from the column. Computing month from a DATE field should be just as fast as computing from a DATETIME column I would think. Also splitting

Re: Date v. DateTime index performance

2007-01-09 Thread Chris
Anders Lundgren wrote: One potential solution might be to use an extra column that tracks month_number, and populate it with a trigger on insert or update. Index that field and then use it in your WHERE clause. One possibility anyway. Resulting question, what if I have three colums

find date an time of a table update

2006-12-21 Thread Marcelo Fabiani
Hi, I didn't find a way to know the time and date of the last update of table, not the data but the table info itself. Is this possible? I want to use this info in order to show it in a web page. Mysql 4.1 Apache Myisam Regards Marcelo Fabiani -- MySQL General Mailing List For list

Re: find date an time of a table update

2006-12-21 Thread ViSolve DB Team
Hi, mysql show table status like 'tablename'\G will report you the date and time of creation, updation,etc of the specified table. 'SHOW STATUS' enables only view. Note 1: For some storage engines, this value is NULL. For example, InnoDB stores multiple tables in its tablespace and the data

interesting date/time query issue

2006-12-15 Thread Thomas Bolioli
I have data that is broken into anything from 30 sec to 15 minute time series (with a DATETIME field). I need to transform all of this into 15 minute data. Does anyone know off the top of their head if there a way I could use GROUP BY to make this happen? Nothing I have tried thus far has

Converting a field or converting a date?

2006-12-05 Thread Néstor
People, I am not very savy with SQL and I need help. I have a char field that contains a date and the date is in DD-MM- and I want to sort it but the sort is wrong because 01-04-2007 comes out before 10-22-2006. Is there an easy way to provide a correct sorted output list or do I need

Re: Converting a field or converting a date?

2006-12-05 Thread Dan Nelson
In the last episode (Dec 05), Nstor said: I am not very savy with SQL and I need help. I have a char field that contains a date and the date is in DD-MM- and I want to sort it but the sort is wrong because 01-04-2007 comes out before 10-22-2006. Is there an easy way to provide

RE: MySQL Date Issues

2006-12-04 Thread Price, Randall
: MySQL Date Issues Not sure this is your problem, but do you have the Allow zero datetime option on your connect string? For example, connectionString=Server=localhost; User ID=some_user; Password=some_password; Database=some_database

RE: MySQL Date Issues

2006-12-04 Thread Price, Randall
Jesse, There are many ways to convert the datetime to its various parts; short date, short time, month, day, year, hour, minute, seconds, etc. Here is ShortDate (mm/dd/): %# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, AddedDate)).ToShortDateString() % Here is ShortTime

Date v. DateTime index performance

2006-12-04 Thread Thomas Bolioli
If one has a large number of records per month and normally searches for things by month, yet needs to keep things time coded, does anyone know if it make sense to use datetime or separate date and a time columns? Thanks, Tom -- MySQL General Mailing List For list archives: http

Re: Date v. DateTime index performance

2006-12-04 Thread Dan Buettner
Thomas, I do not think in this case that one is better than the other, for the most part, because both require using a value computed from the column. Computing month from a DATE field should be just as fast as computing from a DATETIME column I would think. Also splitting into DATE and TIME

MySQL Date Issues

2006-12-01 Thread Jesse
the user clicks an Edit link and it brings up the date and time part separately. When I try to run the following code: StartDate.Text = FormatDateTime(RS(StartDateTime),2) StartTime.Text = FormatDateTime(RS(StartDateTime),3) I get the error, Cast from type 'MySqlDateTime' to type 'Date

RE: MySQL Date Issues

2006-12-01 Thread Price, Randall
- From: Jesse [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 4:45 PM To: MySQL List Subject: MySQL Date Issues OK, I'm about to pull my hair out with this one. I know it's simple, but I can't find a way to do this other than switching it to a string and parsing it out manually

optional date field and NULL

2006-11-15 Thread James Neff
INTO enrollments (Name, DateOfBirth) VALUES ('Joe', (SELECT IF(LENGTH({date_of_birth}) = 0, NULL, '{date_of_birth}'))) The {date_of_birth} is a variable and is provided by the client application. I can assure that is either a valid date format or empty string. Error I am getting: You have an error

Re: optional date field and NULL

2006-11-15 Thread James Neff
that is either a valid date format or empty string. Error I am getting: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') = 0, NULL, '')), Is there a better way to handle optional dates that I am missing

Max date in recordset

2006-11-14 Thread Vittorio Zuccalà
Hello, i've a table with a lot of field and in particular: InsertDate,Box,Prt Example: InsertDate, Box, PRT 2006-11-01, BXT, 34 2006-11-01, TTS, 33 2006-11-01, RRT, 55 2006-11-02, BXT, 22 2006-11-02, TTS, 99 2006-11-02, SAR, 75 I'd like to find all record inserted in the last day... In this

Re: Max date in recordset

2006-11-14 Thread Jo�o C�ndido de Souza Neto
select * from table where InsertDate = date_sub(now,interval 1 day) limit 3; Not tested, but i think it will work fine. Vittorio Zuccalà [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Hello, i've a table with a lot of field and in particular: InsertDate,Box,Prt Example:

Re: Max date in recordset

2006-11-14 Thread Dan Buettner
If you're looking for the records from the last full day contained in the data, not the past 24 hours according to the clock, then this ought to work: select * from table where InsertDate = date_sub( (select max(InsertDate from table),interval 1 day) order by InserDate desc Dan On 11/14/06,

RE: Max date in recordset

2006-11-14 Thread Jerry Schwartz
Assuming that insertdate is a DATE column, SELECT * FROM t WHERE t.insertdate = (SELECT MAX(t.insertdate) FROM t)); would do it. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message

RE: Max date in recordset

2006-11-14 Thread Jerry Schwartz
From what I know, your solution would only work if you have exactly three records to find (there might be 1 or 100), only if the latest records fall within the last three days. I think Vittorio said he didn't know ahead of time what most recent date would be. Regards, Jerry Schwartz Global

Check date interval in SELECT

2006-10-29 Thread spacemarc
Hi I have 3 fields like this: id date_in date_out 1 2006-09-05 2006-09-10 2 2006-09-15 2006-09-20 3 2006-09-25 2006-09-30 Example: if I have an time interval like '2006-09-05' and '2006-09-21', I have to search, in the same time, only the records that not included in time

Re: Check date interval in SELECT

2006-10-29 Thread David Thole
I'm not 100% sure I'm understanding your requirements, but this query: select id from datetest where date_in not between '2006-09-05' and '2006-09-21' and date_out not between '2006-09-05' and '2006-09-21'; should do exactly as you want for getting id3 if I'm understanding the requirements

Re: change format of date fields during LOAD DATA INFILE?

2006-10-25 Thread Paul DuBois
At 21:39 -0400 10/14/06, Ferindo Middleton wrote: Is there a way to change the format of date fields MySQL is expecting when LOADing data from a file? I have no problem with the format MySQL saves the date but most spreadsheet programs I use don't make it easy to export text files with date

RE: change format of date fields during LOAD DATA INFILE?

2006-10-16 Thread Jerry Schwartz
I just tested it with Excel, as it will save the date as seen if you save the worksheet to a text file. I do this quite a bit, actually, to put spreadsheet data into MySQL. Often I use Excel macros to construct entire UPDATE or INSERT statements, and save those into a text file for MySQL to inhale

Re: change format of date fields during LOAD DATA INFILE?

2006-10-16 Thread Ferindo Middleton
format when performing the operation on the command line though? Ferindo On 10/16/06, Jerry Schwartz [EMAIL PROTECTED] wrote: I just tested it with Excel, as it will save the date as seen if you save the worksheet to a text file. I do this quite a bit, actually, to put spreadsheet data

Re: change format of date fields during LOAD DATA INFILE?

2006-10-15 Thread mos
At 08:39 PM 10/14/2006, Ferindo Middleton wrote: Is there a way to change the format of date fields MySQL is expecting when LOADing data from a file? I have no problem with the format MySQL saves the date but most spreadsheet programs I use don't make it easy to export text files with date

change format of date fields during LOAD DATA INFILE?

2006-10-14 Thread Ferindo Middleton
Is there a way to change the format of date fields MySQL is expecting when LOADing data from a file? I have no problem with the format MySQL saves the date but most spreadsheet programs I use don't make it easy to export text files with date fields in the format -MM-DD even if I formated

Re: Need to find last price and date product was sold

2006-09-28 Thread Jo�o C�ndido de Souza Neto
step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row for each Product_Code, Date combination. So over the past year a product_code could have over 300 rows, one row for each day it was sold. There are thousands of products

Re: Need to find last price and date product was sold

2006-09-28 Thread Jonathan Mangin
Section 3.6.2 of the 4.1 manual has this example using a subselect: SELECT article, dealer, price FROM shop WHERE price=(SELECT MAX(price) FROM shop); I use this basic syntax with max(date) alot. - Original Message - From: João Cândido de Souza Neto [EMAIL PROTECTED] To: mysql

Re: Need to find last price and date product was sold

2006-09-28 Thread Peter Brawley
.product_code; There's a bit of discussion at http://www.artfulsoftware.com/queries.php#7/ PB - mos wrote: This should be easy but I can't find a way of doing it in 1 step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row for each

Re: Need to find last price and date product was sold

2006-09-28 Thread Douglas Sims
/ queries.php#7/ PB - mos wrote: This should be easy but I can't find a way of doing it in 1 step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row for each Product_Code, Date combination. So over the past year a product_code

Re: Need to find last price and date product was sold

2006-09-28 Thread mos
and maxdate=t2.date_xact order by t1a.account; Mike mos [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] This should be easy but I can't find a way of doing it in 1 step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row

Need to find last price and date product was sold

2006-09-27 Thread mos
This should be easy but I can't find a way of doing it in 1 step. I have a Trans table like: Product_Code: X(10) Date_Sold: Date Price_Sold: Float Now there will be 1 row for each Product_Code, Date combination. So over the past year a product_code could have over 300 rows, one row for each

Re: Need to find last price and date product was sold

2006-09-27 Thread Douglas Sims
You could do something like that by using a derived table (subselect) to pick the max date for each product sale and then joining that on the products table again to pick up the amounts. Note that you must use mysql 5.x to be able to use subselects. Also this will return multiple rows

finding row with latest date in a range from joined tables in v4.0.26

2006-09-22 Thread rc.msn
unique series, p has multiple programmes and s has multiple speakers I'm trying to pick out the latest programme in each series in a date range and include the series full name (prog_name) and speaker full name (spk_name) from the other tables. I've played around with joins but cannot seem to get

Re: finding row with latest date in a range from joined tables in v4.0.26

2006-09-22 Thread Dan Buettner
unique series, p has multiple programmes and s has multiple speakers I'm trying to pick out the latest programme in each series in a date range and include the series full name (prog_name) and speaker full name (spk_name) from the other tables. I've played around with joins but cannot seem to get

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Chris Jones
Use a command line tool to change the date. I am only familiar with perl and it would be a very short script to change to -MM-DD. At 10:48 PM 9/2/2006, David Perron wrote: I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Chris W
David Perron wrote: I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data type in the table or a method to indicate the date format in the LOAD DATA statement in order to handle this? in VI the following should work depending

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Brad Jahnke
I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data type in the table or a method to indicate the date format in the LOAD DATA statement in order to handle this? If you are using MySQL 5.0.3 or greater, you should be able

Is there a way to load non-native Date type with LOAD DATA

2006-09-02 Thread David Perron
I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data type in the table or a method to indicate the date format in the LOAD DATA statement in order to handle this? Thanks in advance for any help! David -- MySQL General Mailing

Re: select between date

2006-08-29 Thread Penduga Arus
On 8/3/06, Penduga Arus [EMAIL PROTECTED] wrote: On 8/1/06, Chris [EMAIL PROTECTED] wrote: Did you look at the link David sent you? http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html thanks.. I manage to do that.. below is my solution. please advice if there is any better

Re: select between date

2006-08-29 Thread Douglas Sims
You have a table containing birthdates (date field, including year) and you want to display all rows for which the birthday will occur in the next week (seven days). You tried this query: SELECT a017namaper, DATE_FORMAT(a017tkhlahir, '%e/%c/%Y') as a017tkhlahir, MONTH(a017tkhlahir

Why does MySQL accept fake date?

2006-08-26 Thread Mark
Dear MySQL-ers, Using MySQL 4.1.20, in the function DAYOFWEEK(), why does MySQL accept a bogus date like '2006-02-30'? It says the 30th of February (yeah, right) starts on a the 5th day. I was going to use this to create a table of how many days there are in each month, but that's completely

Re: Why does MySQL accept fake date?

2006-08-26 Thread Rocco
Hello Mark, in Versions of MySQL prior to 5.0.2 it is only checked that the year-part ranges from 1000-, the month-part from 1-12 and the day-part ranges from 1-31 within the date column. With 5.0.2 of MySQL the Dates must be legal, so 2006-02-31 is no more possible by default. You can

RE: Why does MySQL accept fake date?

2006-08-26 Thread Mark
there are in each month for the next ten years (that's what the 'invalid date' test was supposed to do), and at what day of the week they start. In MySQL 5.0.2 this really worked very well. Thank you! :) Hello Mark, in Versions of MySQL prior to 5.0.2 it is only checked that the year-- part ranges from

ddmmyyyy-format date hangs MySQL - 5.0.22/InnoDB/WinXP-SP2

2006-08-16 Thread Asif Lodhi
Hi, In my earlier post, I was making a mistake (though I didn't do so in the posted text!) - I was passing the dob (the date field) in the ddmm format. When I passed the date field in mmdd format, the stored procedure ran fine and the record got inserted. The problem is MySQL hangs

Re: select between date

2006-08-03 Thread Penduga Arus
On 8/1/06, Chris [EMAIL PROTECTED] wrote: Did you look at the link David sent you? http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html thanks.. I manage to do that.. below is my solution. please advice if there is any better solution SELECT a017namaper, DATE_FORMAT

select between date

2006-07-31 Thread Penduga Arus
I want to do a program to display birthday for our staff. I have a field named birthday with date format (-mm-dd), from this field I want to display the staff who will have their birthday start from current date to 7 days a head. please help, thanks in advance -- MySQL General Mailing List

RE: select between date

2006-07-31 Thread Logan, David (SST - Adelaide)
Hi, Try here http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Regards --- ** _/ ** David Logan *** _/ *** ITO Delivery Specialist - Database

RE: select between date

2006-07-31 Thread Peter Lauri
What version of MySQL do you have? Depending on that, there are different methods. -Original Message- From: Penduga Arus [mailto:[EMAIL PROTECTED] Sent: Monday, July 31, 2006 6:33 PM To: mysql@lists.mysql.com Subject: select between date I want to do a program to display birthday

Re: select between date

2006-07-31 Thread Chris
Penduga Arus wrote: On 7/31/06, Peter Lauri [EMAIL PROTECTED] wrote: What version of MySQL do you have? Depending on that, there are different methods. MySQL 5, can you please show me how to do it.. Did you look at the link David sent you? http://dev.mysql.com/doc/refman/5.0/en/date

How to query on part of a date column?

2006-07-20 Thread Barry Newton
I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from Capclave2005reg Where Year('Date Paid') = 2004

Re: How to query on part of a date column?

2006-07-20 Thread Dan Buettner
Barry, I think you've got too many quotes in your SQL - the db is trying to find the year from the string 'date paid'. You want to use it as a column name, so drop the quotes: Select * from Capclave2005reg Where Year(Date Paid) = 2004; If you've really got a space in your column name, try

Re: How to query on part of a date column?

2006-07-20 Thread mos
At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from Capclave2005reg

Re: How to query on part of a date column?

2006-07-20 Thread Martin Jespersen
As long as backticks are used around fieldnames, spaces and/or reserved words are fine, tho it does tend to create more work for the user ;) mos wrote: At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept

Re: How to query on part of a date column?

2006-07-20 Thread mos
mos wrote: At 12:02 PM 7/20/2006, you wrote: I've got a table of people who registered for a convention. Each person has a registration date, kept in a standard date field. How do I select for people who registered in a particular month or year? The obvious tests like: Select * from

Date comparisons

2006-07-14 Thread Chris Sansom
I've found something that works (in MySQL 5, anyway), but I don't know whether it's accepted practice. If I want to find all records with a date in, say, March 2006, it works if I use datefield like '2006-03%' because it's a string. This seems kind of obvious and a lot tidier than doing

Re: Date comparisons

2006-07-14 Thread Philip Hallstrom
I've found something that works (in MySQL 5, anyway), but I don't know whether it's accepted practice. If I want to find all records with a date in, say, March 2006, it works if I use datefield like '2006-03%' because it's a string. This seems kind of obvious and a lot tidier than doing

<    1   2   3   4   5   6   7   8   9   10   >