Re: setting the default of a date field

2012-01-28 Thread william drescher
On 1/27/2012 6:00 PM, Peter Brawley wrote: On 1/27/2012 2:24 PM, william drescher wrote: On 1/27/2012 3:21 PM, Peter Brawley wrote: On 1/27/2012 11:18 AM, william drescher wrote: Is there a way to set the default of a date field to the date the record is generated ? bill Use a TIMESTAMP

Re: setting the default of a date field

2012-01-27 Thread Peter Brawley
On 1/27/2012 2:24 PM, william drescher wrote: On 1/27/2012 3:21 PM, Peter Brawley wrote: On 1/27/2012 11:18 AM, william drescher wrote: Is there a way to set the default of a date field to the date the record is generated ? bill Use a TIMESTAMP. Default DATE(TIME) columns with Triggers

Re: setting the default of a date field

2012-01-27 Thread william drescher
On 1/27/2012 3:21 PM, Peter Brawley wrote: On 1/27/2012 11:18 AM, william drescher wrote: Is there a way to set the default of a date field to the date the record is generated ? bill Use a TIMESTAMP. Default DATE(TIME) columns with Triggers. PB When I try ALTER TABLE `ptInfo` CHANGE

Re: setting the default of a date field

2012-01-27 Thread Peter Brawley
On 1/27/2012 11:18 AM, william drescher wrote: Is there a way to set the default of a date field to the date the record is generated ? bill Use a TIMESTAMP. Default DATE(TIME) columns with Triggers. PB -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

' . . ' can't insert into a date field,but update can

2008-04-11 Thread wang shuming
t; space(4)+"."+space(2)+"."+space(2) 2) update table1 set date=' . . ' // this done . I hope can insert a '. . ' value to a date field . Mysql 5.0.51 Regards! Shuming Wang

Re: optional date field and NULL

2006-11-15 Thread James Neff
This always happens to me. I end up solving my own problem a second after I hit the send button to the mailing list. The answer was that I needed single quotes around my first parameter '{date_of_birth}' like this: INSERT INTO enrollments (Name, DateOfBirth) VALUES ('Joe', (SELECT IF(LENGTH

optional date field and NULL

2006-11-15 Thread James Neff
I have a table like so: enrollments - ID - INT Name - VARCHAR(45) DateOfBirth - DateTime The DateOfBirth field should be optional and allow NULLs if there is nothing present. How do I do this in my INSERT? I've tried: INSERT INTO enrollm

Re: Defaulting Date Field

2006-06-26 Thread Dan Buettner
Jesse, a TIMESTAMP column in your table can be set to have the 'now' value when a row is inserted, or updated, or both. http://dev.mysql.com/doc/refman/5.0/en/timestamp-4-1.html Note the warning about TIMESTAMP behavior differing significantly prior to 4.1. Dan Jesse wrote: What is the bes

Defaulting Date Field

2006-06-26 Thread Jesse
What is the best way to default a date/time field to the current date/time? I've tried using Now(), but I get an error of course. The only other way I know of to do this is to add a trigger, which I can do, but I find them bothersome, because they don't tend to backup and restore properly. Is

Re: how to default ... DATE column to another column date field, without using a trigger?

2006-05-19 Thread Ferindo Middleton
I have a similar desire like my first question regarding a DATETIME field. I have a DATETIME field in my db that I would like to DEFAULT to the exact value of another DATETIME field in the same table... However, if I write a trigger for this and the application or the user or someone accessing the

Re: Date Field Reverting to 0000-00-00 Format

2006-03-27 Thread Lola J. Lee Beno
Michael Stassen wrote: So, take a look at yarn_date.txt and let us know. Yes, you're right . . . there was an extra tab stop. When I deleted the extra tab, the date field were retained successfully. Thanks! -- Lola - mailto:[EMAIL PROTECTED] http://www.lolajl.net | Blog at

Re: Date Field Reverting to 0000-00-00 Format

2006-03-26 Thread Michael Stassen
Lola J. Lee Beno wrote: Here's an example of one of the tables where the date was retained successfully, with the string to the right of the decimal point being trimmed: 1Cobweb2005-01-13 15:21:50.654149 2Lace Weight2005-01-13 15:21:50.654149 3Sock2005-01-13 15:21:50.6

Re: Date Field Reverting to 0000-00-00 Format

2006-03-26 Thread Lola J. Lee Beno
Michael Stassen wrote: Just a quick reply for now . . . Ummm, if you delete the numbers to the *left* of the decimal point, "2005-01-15 10:15:42.41837" will turn into ".41837", which is still not a valid datetime. You need to delete the numbers to the *right* of the decimal point (which I ex

Re: Date Field Reverting to 0000-00-00 Format

2006-03-25 Thread Michael Stassen
Lola J. Lee Beno wrote: I have a bunch of data where one of the columns is a date field. Here's a sample of the data that I have: 141415010001 02005-01-15 10:15:42.41837 281512010002 02005-01-15 10:22:37.756594 3

Date Field Reverting to 0000-00-00 Format

2006-03-25 Thread Lola J. Lee Beno
I have a bunch of data where one of the columns is a date field. Here's a sample of the data that I have: 1 4 14 150 1 0 0 0 1 0 2005-01-15 10:15:42.41837 2 8 15 120 1 0 0 0

Re: DATE field key depends on value?

2006-01-23 Thread sheeri kritzer
Thanx, that's exactly it. I feel a bit embarassed as this came up on the list about 2-3 weeks ago, and I found the answer as I was waiting for the replies. -Sheeri On 1/20/06, gerald_clark <[EMAIL PROTECTED]> wrote: > sheeri kritzer wrote: > > >Hi folks, > > > >I'm attempting to optimize a quer

Re: DATE field key depends on value?

2006-01-20 Thread gerald_clark
sheeri kritzer wrote: Hi folks, I'm attempting to optimize a query -- it's quite a simple one, actually. SELECT uid from Bill_Sales WHERE startDate > '[some date]'; mysql> show create table Bill_Sales\G *** 1. row *** Table: Bill_Sales Cre

Re: DATE field key depends on value?

2006-01-20 Thread sheeri kritzer
Realized I should probably show the Bill_Sales table. . . ls -lh Bill_Sales.* -rw-rw 1 mysql mysql 104M Jan 20 15:11 Bill_Sales.MYD -rw-rw 1 mysql mysql 97M Jan 20 15:11 Bill_Sales.MYI -rw-rw 1 mysql mysql 9.2K Jan 3 13:43 Bill_Sales.frm mysql> show table status like "Bill_Sales"

DATE field key depends on value?

2006-01-20 Thread sheeri kritzer
Hi folks, I'm attempting to optimize a query -- it's quite a simple one, actually. SELECT uid from Bill_Sales WHERE startDate > '[some date]'; mysql> show create table Bill_Sales\G *** 1. row *** Table: Bill_Sales Create Table: CREATE TABLE

RE: Format for saving date field.

2005-11-10 Thread Gordon Bruce
environment. {Command line, SQLYOG, Query Browser etc.} -Original Message- From: Jesse Castleberry [mailto:[EMAIL PROTECTED] Sent: Thursday, November 10, 2005 1:49 PM To: MySQL List Subject: Format for saving date field. When doing an update or insert into a database with a date field, the

Format for saving date field.

2005-11-10 Thread Jesse Castleberry
When doing an update or insert into a database with a date field, the format for the data on the screen is m/d/. However, I believe that MySQL is expecting it in the format of -mm-dd. I'm using MySQL in an ASP.Net application. Is there an EASY way to convert to the data to a format

Re: LATEST N RECORDS from a table without date field

2005-08-24 Thread Jason Pyeron
On Wed, 24 Aug 2005, Harald Fuchs wrote: "Praveen KS" <[EMAIL PROTECTED]> writes: Can anyone help with a query to retrieve latest N records. No auto_increment field. No date field. Primary key exists and is populated with random unique values. This means that the only pos

Re: LATEST N RECORDS from a table without date field

2005-08-24 Thread Pooly
e help with a query to retrieve latest N records. > > No auto_increment field. > > No date field. > > Primary key exists and is populated with random unique values. > > This means that the only possible definition for "latest" is "highest slno". > Transl

Re: LATEST N RECORDS from a table without date field

2005-08-24 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Praveen KS" <[EMAIL PROTECTED]> writes: > Can anyone help with a query to retrieve latest N records. > No auto_increment field. > No date field. > Primary key exists and is populated with random unique values. This means tha

Re: LATEST N RECORDS from a table without date field

2005-08-24 Thread Felix Geerinckx
On 24/08/2005, "Praveen KS" wrote: > Can anyone help with a query to retrieve latest N records. > > No auto_increment field. > No date field. > Primary key exists and is populated with random unique values. In a table, there are no such things as - the first record

LATEST N RECORDS from a table without date field

2005-08-24 Thread Praveen KS
Can anyone help with a query to retrieve latest N records. No auto_increment field. No date field. Primary key exists and is populated with random unique values. Eg: slno int(10) primary key (populated with random unique values) name char(20) Thanks in advance. PraveenKumarKS http

Re: key on the month portion of a date field

2005-02-09 Thread Greg Fortune
) Then, add an index on that column and test your queries against the new index. I'd be surprised if you saw much increase in speed, especially as your data set grows. Greg On Wednesday 09 February 2005 09:17 am, Gabriel B. wrote: > Short Version: > is there any way to make an index

Re: key on the month portion of a date field

2005-02-09 Thread Gary Richardson
On Wed, 9 Feb 2005 15:17:36 -0200, Gabriel B. <[EMAIL PROTECTED]> wrote: > It is not too slow this way since i started the WHERE with lots of > checks that cuts down to a medium of 200 rows that actualy gets to > this check, but i feel uncorfotable to not use a index. Isn't there a limit of 1 ind

Re: key on the month portion of a date field

2005-02-09 Thread Paul DuBois
At 15:37 -0200 2/9/05, Gabriel B. wrote: On Wed, 09 Feb 2005 17:24:10 +, love <[EMAIL PROTECTED]> wrote: alter table table_name add index (birthday); But would that index improve this kind of query? the docs talk about only direct matchs, like "birthday < now()" or" birthday between x and y"

Re: key on the month portion of a date field

2005-02-09 Thread Gabriel B.
On Wed, 09 Feb 2005 17:24:10 +, love <[EMAIL PROTECTED]> wrote: > alter table table_name add index (birthday); But would that index improve this kind of query? the docs talk about only direct matchs, like "birthday < now()" or" birthday between x and y". They're all full date values. -- My

Re: key on the month portion of a date field

2005-02-09 Thread love
use below: alter table table_name add index (birthday); Love Kumar .. [EMAIL PROTECTED] wrote: Short Version: is there any way to make an index for a date field that appears in the WHERE as a MONTH() argument? I have a table with some hundreds of thousands of rows already, and now i have the need

key on the month portion of a date field

2005-02-09 Thread Gabriel B.
Short Version: is there any way to make an index for a date field that appears in the WHERE as a MONTH() argument? I have a table with some hundreds of thousands of rows already, and now i have the need to show upcoming birthdays to some users. the query uses WHERE MONTH(birthday).. the

Re: Problem with date field

2004-11-05 Thread Steve Grosz
t; example, db description, etc.) would permit > some humble humans to take a guess ... > > - Original Message - > From: "Steve Grosz" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, November 05, 2004 8:13 AM > Subject: Problem with

Re: Problem with date field

2004-11-05 Thread Steve Grosz
rosz" <[EMAIL PROTECTED]> wrote: > > Why am I having a problem getting a date field to hold date? I will store > > 2004-10-15, save the record. Reopen the record, and there is just > > -00-00 > > > > What's going on here? > > > >

Re: Problem with date field

2004-11-05 Thread Gleb Paharenko
Hi. If you send us output of "show create table 'table_with_date_field'", and queries, which you use to insert and retrieve date, may be we will be able to help you. "Steve Grosz" <[EMAIL PROTECTED]> wrote: > Why am I having a problem getting a

Re: Problem with date field

2004-11-05 Thread Markus Grossrieder
IL PROTECTED]> Sent: Friday, November 05, 2004 8:13 AM Subject: Problem with date field > Why am I having a problem getting a date field to hold date? I will store > 2004-10-15, save the record. Reopen the record, and there is just > -00-00 > > What's going on he

Problem with date field

2004-11-04 Thread Steve Grosz
Why am I having a problem getting a date field to hold date? I will store 2004-10-15, save the record. Reopen the record, and there is just -00-00 What's going on here? Thanks Steve -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: [Q] setting DATE field with default NOW value?

2004-02-05 Thread Brent Baisley
If you update the row with NULL for the TIMESTAMP field it will enter the current date and time. On Feb 5, 2004, at 7:18 AM, Martijn Tonies wrote: you can use TIMESTAMP data type, which have default NOW() Not exactly. 1) TIMESTAMP also updates when you update the row, unless you set the colum

Re: [Q] setting DATE field with default NOW value?

2004-02-05 Thread Martijn Tonies
ion, how do I get a date field to be > > assigned as DEFAULT the current date? With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com -- MySQL General Mailing List For list archives: ht

Re: [Q] setting DATE field with default NOW value?

2004-02-05 Thread KKoTY
you can use TIMESTAMP data type, which have default NOW() - Original Message - From: "Riaan Oberholzer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 05, 2004 12:38 PM Subject: [Q] setting DATE field with default NOW value? > In a table d

Re: [Q] setting DATE field with default NOW value?

2004-02-05 Thread Martijn Tonies
Hi, > In a table definition, how do I get a date field to be > assigned as DEFAULT the current date? > > I tried: > > dateField DATE DEFAULT CURDATE() > > but that gives me syntax errors > > Help? According to the documentation for the DEFAULT clause, c

[Q] setting DATE field with default NOW value?

2004-02-05 Thread Riaan Oberholzer
In a table definition, how do I get a date field to be assigned as DEFAULT the current date? I tried: dateField DATE DEFAULT CURDATE() but that gives me syntax errors Help? __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http

Re: Default DATE field values

2004-01-04 Thread Chris Nolan
;t want it update > when you UPDATE the row, you can just set it to its current value, if > you weren't aware of that. > > > Matt > > > - Original Message - > From: "Chris Nolan" > Sent: Saturday, January 03, 2004 10:34 AM > Subject: Defau

Re: Default DATE field values

2004-01-03 Thread Matt W
rrent value, if you weren't aware of that. Matt - Original Message - From: "Chris Nolan" Sent: Saturday, January 03, 2004 10:34 AM Subject: Default DATE field values > Hi all, > > Upon reading the funky manual, I have discovered the following things: > >

Default DATE field values

2004-01-03 Thread Chris Nolan
Hi all, Upon reading the funky manual, I have discovered the following things: 1. TIMESTAMP fields can be set so that their default value is NOW(). 2. DATE and TIMESTAMP fields are related. Given the two above facts, is there a way to set DATE columns so the default value is NOW()? My playing ar

RE: Date Field

2003-10-26 Thread Freddie Sorensen
Eduardo Use the format '-mm-dd' instead By the way, there is an excellent manual on http://www.mysql.com including all the field types and formats Freddie -Original Message- From: Eduardo Melo [mailto:[EMAIL PROTECTED] Sent: Sonntag, 26. Oktober 2003 16:15 To: [EMAIL PROTECTED]

Date Field

2003-10-26 Thread Eduardo Melo
Hi All ! I have a datetime field in a table. When I use insert into table (aniversary) values ('24/10/2003'). The date is save as 20/10/2024. I am using dd/mm/ What can I do to save the date correctely ? best regards, Eduardo F. Melo ___

RE: Pull updated Records without a date field?

2003-07-11 Thread Rudy Metzger
ed Records without a date field? Hello, Is there a way to pull all updated records without having a date field in each record? -- Keith -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL Gene

RE: Pull updated Records without a date field?

2003-07-10 Thread Andrew Braithwaite
> Is there a way to pull all updated records without having a date field in each record? No. Generally speaking it's a good idea to have a timestamp field in these oft updated tables to perform just the kind of operation you describe. Cheers, Andrew -Original Message- Fro

Re: Pull updated Records without a date field?

2003-07-10 Thread Ryan McDougall
--- Paul DuBois <[EMAIL PROTECTED]> wrote: > At 11:38 -0500 7/10/03, Keith Hamilton wrote: > >Hello, > > > > Is there a way to pull all updated records without having a date > >field in each record? > >-- Keith Can't you just do: select field from

Re: Pull updated Records without a date field?

2003-07-10 Thread Paul DuBois
At 11:38 -0500 7/10/03, Keith Hamilton wrote: Hello, Is there a way to pull all updated records without having a date field in each record? How do you determine which records have been updated in that case? -- Keith -- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL

Pull updated Records without a date field?

2003-07-10 Thread Keith Hamilton
Hello, Is there a way to pull all updated records without having a date field in each record? -- Keith -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Update Year of Date Field using sql statement

2003-01-05 Thread Daniel Kasak
Hakkan Lui wrote: >Dear all, > >How can I change the year of the date field using sql statement? > >It means something like: >update table1 set year(f1) = '2002' where year(f1) = '2003'; > > If you have a field for _just_ the year, you can use the ab

Re: Update Year of Date Field using sql statement

2003-01-05 Thread Paul DuBois
--- Original Message - From: "Hakkan Lui" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 05, 2003 10:12 PM Subject: Update Year of Date Field using sql statement Dear all, How can I change the year of the date field using sql statement? It means s

Re: Update Year of Date Field using sql statement

2003-01-05 Thread Bhavin Vyas
t: Sunday, January 05, 2003 10:12 PM Subject: Update Year of Date Field using sql statement > Dear all, > > How can I change the year of the date field using sql statement? > > It means something like: > update table1 set year(f1) = '2002' where year(f1) = '2003

Update Year of Date Field using sql statement

2003-01-05 Thread Hakkan Lui
Dear all, How can I change the year of the date field using sql statement? It means something like: update table1 set year(f1) = '2002' where year(f1) = '2003'; Thanks for anyone's help. Regards, Hakkan Lui ---

Re: Date field

2002-12-09 Thread Benjamin Pflugmann
Hello. On Sun 2002-12-08 at 16:03:22 -0500, [EMAIL PROTECTED] wrote: > > I am trying to store a date in the following format '08/12/2002' pr > '08/12/2002' or any other format if I have to ...on SQLServer 7. This is the mysql list. What has SQLServer 7 to do with MySQL? > Basically I want to us

Date field

2002-12-08 Thread Sam4Software
Hi. I am trying to store a date in the following format '08/12/2002' pr '08/12/2002' or any other format if I have to ...on SQLServer 7. Basically I want to use TodaysDate = Date' Date is the system date function strSQL = "SELECT * FROM CallBacks WHERE CallDate =" & TodaysDate Is there a

Re: date field - default value = current date

2002-09-18 Thread Paul DuBois
At 1:32 -0700 9/18/02, neal wrote: >Is there a wat to have mySQL auto fill in the current date into my >dateCreated field? > >In SQLServer I would simply specify the getDate() method as a default value. >I presume I would use the analogous MySQL function curDate() but it does not >appear to work f

re: date field - default value = current date

2002-09-18 Thread Egor Egorov
neal, Wednesday, September 18, 2002, 11:32:39 AM, you wrote: n> Is there a wat to have mySQL auto fill in the current date into my n> dateCreated field? n> In SQLServer I would simply specify the getDate() method as a default value. n> I presume I would use the analogous MySQL function curDate()

Re: date field - default value = current date

2002-09-18 Thread Mikhail Entaltsev
Check TIMESTAMP type in the documentation. Best regards, Mikhail. - Original Message - From: "neal" <[EMAIL PROTECTED]> To: "mySQL" <[EMAIL PROTECTED]> Sent: Wednesday, September 18, 2002 10:32 AM Subject: date field - default value = current date >

date field - default value = current date

2002-09-18 Thread neal
Is there a wat to have mySQL auto fill in the current date into my dateCreated field? In SQLServer I would simply specify the getDate() method as a default value. I presume I would use the analogous MySQL function curDate() but it does not appear to work for me. Any suggestions? -

Re: Default created date field

2002-07-15 Thread Shawn Poulson
[EMAIL PROTECTED]>, >[EMAIL PROTECTED] >Subject: Re: Default created date field >Date: Mon, 15 Jul 2002 17:56:18 +0200 > >On Monday, 15. July 2002 16:51, Shawn Poulson wrote: > >Hi, > > > I'm having trouble doing this in MySQL, but it keeps co

Re: Default created date field

2002-07-15 Thread Georg Richter
On Monday, 15. July 2002 16:51, Shawn Poulson wrote: Hi, > I'm having trouble doing this in MySQL, but it keeps complaining. All I > have to work on is: > create table mytable ( >createddate datetime not null default now() > ) > Just use timestamp instead datetime. Regards Georg mysql,q

Re: Default created date field

2002-07-15 Thread Victoria Reznichenko
Shawn, Monday, July 15, 2002, 5:51:01 PM, you wrote: SP> I'm new to this list and MySQL, so I hope this question isn't too SP> rudimentary. SP> In SQL Server I was able to create a datetime field that used the default SP> getdate() function so that I woudl get timestamps on all created rows S

Default created date field

2002-07-15 Thread Shawn Poulson
Hello all, I'm new to this list and MySQL, so I hope this question isn't too rudimentary. In SQL Server I was able to create a datetime field that used the default getdate() function so that I woudl get timestamps on all created rows automatically, like: create table mytable ( createddate

RE: MIN/MAX Date Field

2002-07-05 Thread Solsberry, Glendon
e- From: Alain Fontaine [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 11:01 AM To: Solsberry, Glendon; [EMAIL PROTECTED] Subject: RE: MIN/MAX Date Field How about: select some_data from the_table order by the_date ASC limit 1 ? -Message d'origine- De : Solsberry, G

Re: MIN/MAX Date Field

2002-07-05 Thread Richard Davis
Solsberry, Glendon wrote: > Is there a way to select some data from a table where the date field is > the MIN() of that date column? Aka, if I have 100 rows of data, and the > MIN() date is 1/1/2000, then I want to select the data that is from > 1/1/2000. Can this be done without d

RE: MIN/MAX Date Field

2002-07-05 Thread Alain Fontaine
How about: select some_data from the_table order by the_date ASC limit 1 ? -Message d'origine- De : Solsberry, Glendon [mailto:[EMAIL PROTECTED]] Envoye : vendredi 5 juillet 2002 16:52 A : [EMAIL PROTECTED] Objet : MIN/MAX Date Field Is there a way to select some data from a

MIN/MAX Date Field

2002-07-05 Thread Solsberry, Glendon
Is there a way to select some data from a table where the date field is the MIN() of that date column? Aka, if I have 100 rows of data, and the MIN() date is 1/1/2000, then I want to select the data that is from 1/1/2000. Can this be done without doing a multi-table join, or is that the only

RE: Indexing on a DATE field/bizarre speed issue with a LEFT JOIN?

2002-06-10 Thread Matt Rowe
Sorry for the long reply: At 02:57 PM 6/10/2002 -0500, you wrote: >[snip] >SELECT > head.po >FROM > head > LEFT JOIN line ON (head.sn=line.snHead) >WHERE > head.po > 1 > AND line.dateETA<='2002-06-10' >LIMIT 50 > >As is, this query is very fast (0.01 second

RE: Indexing on a DATE field/bizarre speed issue with a LEFT JOIN?

2002-06-10 Thread Jay Blanchard
[snip] SELECT head.po FROM head LEFT JOIN line ON (head.sn=line.snHead) WHERE head.po > 1 AND line.dateETA<='2002-06-10' LIMIT 50 As is, this query is very fast (0.01 seconds when there are 25,000 records in 'head', and 50,000 records in 'line'). However,

Indexing on a DATE field/bizarre speed issue with a LEFT JOIN?

2002-06-10 Thread Matt Rowe
Hi List, I sure do appreciate this list. I'm stumped on the following query: SELECT head.po FROM head LEFT JOIN line ON (head.sn=line.snHead) WHERE head.po > 1 AND line.dateETA<='2002-06-10' LIMIT 50 As is, this query is very fast (0.01 seconds when the

Re: Date Field + Time Field = Datetime Field?

2002-01-11 Thread DL Neil
From: "Anvar Hussain K.M." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 11 January 2002 04:05 Subject: Re: Date Field + Time Field = Datetime Field? > Hi Alex, > > I don't think your problem will solved by making the time columns to full > datetime c

Re: Date Field + Time Field = Datetime Field?

2002-01-10 Thread Anvar Hussain K.M.
Hi Alex, I don't think your problem will solved by making the time columns to full datetime columns as there is no functions to subtract two datetime values directly. But you can can keep the time columns and go on like this: convert the time into seconds using time_to_sec function. subtract f

Date Field + Time Field = Datetime Field?

2002-01-10 Thread Alex Kirk
I've been working with a timesheet database, where all the employees of my small business enter in the hours they work on projects. I've been storing, for each record, a date of work, a start time, and a finish time. When I attempted to write a Perl script to display invoices, though, I ran i

RE: 0000-00-00 vs NULL in Date Field

2001-10-02 Thread Paul DuBois
>Here's what I did: > >mysql> create database testnull; >Query OK, 1 row affected (0.05 sec) > >mysql> use testnull; >Database changed > >mysql> create table info (birth date); >Query OK, 0 rows affected (0.03 sec) > >mysql> show tables; >++ >| Tables_in_testnull | >+--

RE: 0000-00-00 vs NULL in Date Field

2001-10-02 Thread Frank J. Schmuck
Here's what I did: mysql> create database testnull; Query OK, 1 row affected (0.05 sec) mysql> use testnull; Database changed mysql> create table info (birth date); Query OK, 0 rows affected (0.03 sec) mysql> show tables; ++ | Tables_in_testnull | ++ | i

RE: 0000-00-00 vs NULL in Date Field

2001-10-02 Thread Carsten H. Pedersen
> If I read a file into a database with a \N in an empty date field > the field > is populated with -00-00. If I insert a row into the same > database with > NULL in the date field it is populated with NULL. > > Programmatically is there a difference between the

Re: 0000-00-00 vs NULL in Date Field

2001-10-02 Thread Paul DuBois
At 9:06 AM -0400 10/2/01, Frank J. Schmuck wrote: >If I read a file into a database with a \N in an empty date field the field >is populated with -00-00. If I insert a row into the same database with >NULL in the date field it is populated with NULL. > >Programmatically is the

0000-00-00 vs NULL in Date Field

2001-10-02 Thread Frank J. Schmuck
If I read a file into a database with a \N in an empty date field the field is populated with -00-00. If I insert a row into the same database with NULL in the date field it is populated with NULL. Programmatically is there a difference between the two? Thanks Frank

Re: Formatting the DATE field on a web page

2001-08-20 Thread Ian Barwick
le > > I am using mySQL and PHP for my web page database management thingy. I've > managed to get my date field from my Table into my page ($myDate). I was > wondering, how would I format the date from -MM-DD format to something > a bit nicer like DD/MM/YY ? > > Is t

Re: Formatting the DATE field on a web page

2001-08-20 Thread Thomas Spahni
t; managed to get my date field from my Table into my page ($myDate). I was > wondering, how would I format the date from -MM-DD format to something a > bit nicer like DD/MM/YY ? > > Is this meant to be a SQL side thing or a server side language formatting > thin

Formatting the DATE field on a web page

2001-08-20 Thread pc
Hi people I am using mySQL and PHP for my web page database management thingy. I've managed to get my date field from my Table into my page ($myDate). I was wondering, how would I format the date from -MM-DD format to something a bit nicer like DD/MM/YY ? Is this meant to be a SQL

RE: Date Field Help

2001-07-23 Thread Don Read
On 23-Jul-2001 Mike Mike wrote: > Hi Folks, > I'm trying to create a counter for my website. I'm > trying to pull the last 7 days worth of data out of > mysql. My sql statement is as follows. > > SELECT TheDate, Count(TheDate) AS CountOfdate > FROM Counter > WHERE (((TheDate)=Now()-7)) > GROUP

Re: Date Field Help

2001-07-23 Thread David Ecker
Of course, 0 records are ok. Here is an example of mine : mysql> select now(), now()-7; +-++ | now() | now()-7| +-++ | 2001-07-23 21:45:53 | 20010723214546 | +-++ 1 r

Date Field Help

2001-07-23 Thread Mike Mike
Hi Folks, I'm trying to create a counter for my website. I'm trying to pull the last 7 days worth of data out of mysql. My sql statement is as follows. SELECT TheDate, Count(TheDate) AS CountOfdate FROM Counter WHERE (((TheDate)=Now()-7)) GROUP BY TheDate; When I do this Sql Commmand it returns

Re: DATE field with current date as default ?

2001-01-15 Thread Scott Baker
Use the "timestamp" datatype instead of date. At 05:19 PM 1/13/2001 -0500, you wrote: >Hello, > >Is there a way to have a field of type DATE get the current date as its >default? > >Something like ... > >mydatefield DATE DEFAULT curdate() > >...which does not work. But that's the idea. ---

Re: DATE field with current date as default ?

2001-01-13 Thread Paul DuBois
>Hello, > >Is there a way to have a field of type DATE get the current date as its >default? No. Default values in MySQL must be constants. > >Something like ... > >mydatefield DATE DEFAULT curdate() > >...which does not work. But that's the idea. -- Paul DuBois, [EMAIL PROTECTED] ---

DATE field with current date as default ?

2001-01-13 Thread Nick Didkovsky
Hello, Is there a way to have a field of type DATE get the current date as its default? Something like ... mydatefield DATE DEFAULT curdate() ...which does not work. But that's the idea. Best, Nick Didkovsky - Before