Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Comparing Dates


I have a problem with me. I am describing the whole situation. I have a table, the structure of the table is as follows:

Table Name: Announcement
FieldName Data Type(Size)
Announcement Varchar(50)
St_Hr Decimal(10,0)
St_Min Decimal(10,0)
St_Day Decimal(10,0)
St_Mon Decimal(10,0)
St_Year Decimal(10,0)
End_Hr Decimal(10,0)
End_Min Decimal(10,0)
End_Day Decimal(10,0)
End_Mon Decimal(10,0)
End_Year Decimal(10,0)

The data stored is:
Test Announcement,10,20,6,10,2005,11,0,8,10,2005

Now, I have to write a query to retrive announcements after filtering them as per the mentioned Starting and Ending Date & Time. The condition should use the local date and time.




View Complete Forum Thread with Replies

Related Forum Messages:
Comparing Dates?
i have an 8 digit date string that i want to compare to a column of type 'date' in
a MySQL db. the 8 digit string is in the format 'CCYYMMDD'. the question is: do
i need to put it into the 'CCYY-MM-DD' format in order to get correct output from
the datediff function, or can i simply leave it how it is?

View Replies !
Comparing Two Dates?
I am trying to compare dates in MySQL, but one of my dates from the curdate()-1 method, returns a string that looks like this 20081210 curdate() method returns '2008-12-11'

Both are not dates, so they will not compare.

Here is my query:

SELECT Order_Number
FROM <TableName>
WHERE date(Order_Date) BETWEEN curdate() AND curdate() -7;

View Replies !
Comparing Dates And Choosing
if( date_add(cur_date(), interval 30 day)>='$thisDate','$thisDate',date_add(cur_date(),interval 30 day)

So: if the current date plus 30 days is larger then thisDate, use thisDate else use the current date plus 30 days.

View Replies !
Comparing Dates If One Is Unix Timestamp
I'm building a simple cms and i'm trying to get something done.. I store the dates as UNIX timestamps. However i want to add a feature let's say to display how many entries have been posted today. Something like [Articles posted today: 3]

View Replies !
Comparing Dates Y, M, D , Time In Sql Query
ok.. ive finally got my nice little calender setup to output my dates

now

how do i query my database

for example ive got 2 variables
$startdate = 2006-1-1 00:00:01
$enddate = 2006-1-1 23:59:59

these represent the 1st and last second of the first of january 2006

i have a cell in my table (table called challenges) ( cell called time) that contains a date in the same format for each entry

how do i get all the entries between the start time and the end time..

can i use less than < and more than > as these are not really integar values

the column type is datetime but there is also another column of type datetime

View Replies !
Comparing Dates Stored In The Format Yyyy-mm-dd
Hello, I have a date field in a mysql database, that is stored in the format yyyy-mm-dd. I would like to subtract 10 days from the date and then compare it to the current day, so say I select a date in the db is 2008-09-15, I want to compare today (2008-07-28) to 2008-09-05. How would I do this? (I'm using php).

View Replies !
Comparing String Dates To Current Date For Month And Day
Trying to set the display column to a no if the ending date is before or at the current date. Comparing string dates to the current date for month and day only.

Am using CONCAT because the ending date needs to be figured into a date as month_end is in a varchar type and day_end is a tinyint type.

The query does run, but it affects everything where continuous != 'always' - seeming to ignore the AND part.

UPDATE Listings SET display = 'no'
WHERE continuous != 'always'
AND STR_TO_DATE(CONCAT(month_end, '-', day_end), '%M-%e')
<= DATE_FORMAT(CURDATE(), '%M-%e')

What should be done differently here?

View Replies !
Converting MS Access Dates To MySQL Dates During LOAD DATA INPUT ?
My insert code is below. The MySQL server is on my local machine and is version 4.1.22. I am exporting from an access table with 6 fields to a mysql table with those 6 plus 5 more fields. The main problem I am having SO FAR, is converting dates. The data file dates are formated like:
2/2/2006 0:00:00, 12/20/2006 9:22:05

Any ideas how to format those into mysql friendly dates?

Also, how do I convert currency fields in the load data process? I know you use SET by what kind of formula?

===========================================

LOAD DATA INFILE 'C:Documents and Settingspath_to_filedata.txt'
INTO TABLE auto
(field2, field3, field4, field5, currency_field6, field7, date_field8, date_field9)
SET id = MD5(UUID())
FIELDS TERMINATED BY ','
LINES TERMINATED BY '
'

View Replies !
Update String Dates Into Mysql Dates
I've got a table that someone created with varchar fields for month, day, and year. I've added a DATE field to the table, and now I want to combine all three of these strings into one DATE and stick it into the DATE field. Once I've got this done, I can delete those three varchar fields and just have the nice DATE field.

Here's the command I've tried in several variations but no luck--syntax errors every time:

UPDATE SET OCR_Entry_Date = date_format(str_to_date(concat_ws('-', OCR_MM, OCR_DD , OCR_YYYY) ,"%b-%d-%Y"), "%m-%d-%Y") WHERE OCR_YYYY = '1974'

OCR_Entry_Date is a DATE field and the others are the varchar fields. My logic is basically:

1. concatenate the separate field values into a single string
2. convert the string into a date
3. format the date in the way I'd like it in the table

View Replies !
Select Into Two Tables, One With Dates Second With Events For Those Dates
I'm havin' a headache supplying the right query for the following situation:...

View Replies !
MSSQL Dates -&gt; MySQL Dates Automatically?
We're using data feeds that were originally meant for MS SQL and the dates in the data feed (tab delimited text files) are formated like:

Oct 21 2007

In MySQL, the date fields are formatted as datetime fields and when we do an import the dates all come through as 0000-00-00 00:00:00.

We're importing using the MySQL "LOAD DATA LOCAL INFILE" command and just dumping the text files right into freshly truncated tables.

Is there a way when loading the files to find and replace the dates maybe? Can MySQL convert the dates?

I have a shell script downloading an archive and uncompressing, then it runs a PHP script that loops through the files runningt he LOAD DATA command.

Any advice would be appreciated... I'm just looking for the easiest (and least server-intensive) way to get the date issue fixed. We've already tried begging the vendor but they're not yet ready to start supporting other date formats (even though their MS SQL db can output a date format friendly to MySQL).

Thanks!

View Replies !
List All Dates Between 2 Diff Dates
I have a database which stored financial data daily exclude weekend, however sometimes i tend to forget to upload data into the database. How do i write a sql query that would detect the missing dates between from last updated date until the current date.

View Replies !
Dates Pre 1970 And Dates After 2050
i have MySQL version: 4.1.16-nt,

when i try to insert a date pre 1970 or after 2050 into a timestamp field, the date is stored as all 0's,

how can i save a date pre 1970 and after 2050 into a mysql field?

View Replies !
List All The Dates Between 2 Given Dates Using SELECT
how I can list all the dates between 2 dates (inclusive) using SELECT sql statement in mysql?

I have a member table with the following columns:
id int autoincrement
name varchar(40)
join_date date

I want the following output (date, count of members joined on that date):
1 April 2009...... (2 members joined)
2 April 2009...... (0 members joined)
3 April 2009...... (3 members joined)
.....so on ...upto
30 April 2009.....(1 members joined)

For the above output I need the SQL command that is valid in mysql. Is there anyone who can produce the above result with a single SELECT command. Please don't suggest that is possible using php for loop or creating a mysqlorary table first and then inserting all the dates into it. Then make a join between mysql table and members table using date as GROUP by column etc. etc.

I know this is possible using some user variables as I searched through the various SQL tutorial sites. But I am unable to figure out how I can produce a list of all dates between 2 given dates.

View Replies !
Stroring Dates Perior To 1 AD, BC Dates
I need to store some dates that can be BC, However I received a problem indicating Incorrect Datetime.

I have read the documentation, and it says that Date&DateTime types can store from 1000-9999 AD, and Timestamp stores less year ranges. What other options do I have to store dates before 1000 AD !

View Replies !
How To List All Missing Dates Between 2 Dates
I have a database which stored financial data daily exclude weekend, however sometimes i tend to forget to upload data into the database. How do i write a sql query that would detect the missing dates between from last updated date until the current date.

View Replies !
Dates, Dates, Dates - Syntax Help Please!
OK, I have a MySQL table which contains, among others, a field called date which stores dates in the format YYYY-MM-DD HH:MM:SS.

What I'd like to do is select a list of all the months present (without repetition), preferably in the format YYYY-mm

View Replies !
Comparing Age
So the birthdays in my MySQL table are in a column called DOB and in the format of say: March 8 1985.
Now i have my own PHP function that will convert that to a nice numerical value of age relative to today, which is perfect. it is called getAge(). However, i can't seem to be able to parse an SQL query with that function inside...is there any way to parse my own PHP functions inside an SQL query?

View Replies !
Comparing
I'm currently working with two tables; A scheduling table and a document table. Basically I'm trying to make a query that says this -- "give me everything from this month and day in the Document table that's not in the Schedule"


View Replies !
Comparing Versions Of Sql
I'm taking up a new position and have never used sql before although use
and code in lots of other languages. When doing a bit of survey I find
many many versions of commercial and public versions of sql. Can anyone
tell me if the syntax is generally similar or are they completely
different. If I invest time learning mysql on XP or Linux will that be
useful if I end up using something like Oracle later on? The only one I
would avoid is MS.like things that work occasionally.

View Replies !
Comparing Two Tables
I have these tables:

table02
Id | tab01_field
1 | 00258
2 | 00041

Code:

table01
Id | tab01_field
1 | 00258
2 | 00123
3 | 00825
4 | 00041
5 | 00005

table02
Id | tab01_field
1 | 00258
2 | 00041
When run a query to see the common records in both tables it returns a right result
select table01.tab01_campo from table01,table02 where table01.tab01_field=table02.tab01_field

Code:

00258
00041

But when I try to see the the uncommon records it returns
select tab01_campo from table01,table02 where table01.tab01_field<>table02.tab01_field

Code:

00258
00123
00123
00825
00825
00041
00005
00005

You can see, it returns the uncommon records twice, but also returs the common records. How could make a query tah returns only the uncommon records?

Code:

00123
00825
00005

View Replies !
Comparing Times
I'm creating a voting system, and want to prevent people from cheating. Therefore I'm logging their IP, and the time they voted, and what I'm planning to do is have a script which will delete any records which have been in the database for say 24 hours.

To get the length of time I was gonne use:

HOUR(TIMEDIFF(NOW(),time))

View Replies !
Data Comparing
i'm writting a program that uses my sql to compare a date time feild to a date that i have to count call on one date the statment looks like this:

SELECT Count(*) FROM wab_answers WHERE wabScreen=1 And DateDiff(answerTime,'" & curDate & "')=0;

where curDate is string containing the date that i would like to compare. I'm not to sure on the correct way to do this. Just need a push in the right direction.

View Replies !
Comparing Differences
I want to find the fields that are in table A but not in table B.
If I have:

table A: id, name, scoreA
table B: id, name, scoreB


I want to find the scores that are in table A but not in B, by example:

table a: 1,john,12|2,mike,14|3,neal,17

table b: 1,hellen,14|2,nolhan,12|3,vicky,10

After make the query:

Score in A that are not in B: 17

View Replies !
Comparing Columns Using LIKE
I can write "column1 LIKE column2" to compare two columns in a fuzzy way, but what about "%" to indicate what should be compared?

column2 contains a list (separated by spaces) of the single values that can be found in column1, so I need to use %value%. I've already validated the values, and they are always a single word, so there's no risk using LIKE per se.

Any more elegant way to do this without having to resort to a PHP loop?

View Replies !
Comparing Strings
I can't work out but i'll try to present it simply here.
Assume the table "Names".

FirstName, SecondName
Robert Smith
John Jones
Richard Robertson
Mike Richardson
Ian Stevenson

I need to write a query where by it selects all records where the First Name appears as part of any second name. the output should be

Robert Smith
Richard Robertson

Now, I know I can do
SELECT FirstName, LastName
FROM Names
WHERE LastName LIKE '%Richard%';

This will find all records where Richard appears as part of a last name. But I want it to work for any first name not just a specific one. i basicly need the last line to be something int he order of
WHERE LastName LIKE '%FirstName%';
only a version that works.

View Replies !
Comparing Within A Column
i have a table 'packets' with the following structure : ip_src varchar(20),mac_source varchar(20) .now i want to list all those ip_src which would have more than one mac_source.
how do i go about doing this?

View Replies !
Comparing String To Int
I would like to know what is the performance behavior in reading an writing string and int in several database tables.

What i should use in terms of performance, int or string?

View Replies !
Comparing Two Fields With LIKE
Here's the sql:

SELECT *
FROM boxer.lpars a, boxer.libraries b
WHERE b.lpars LIKE '%a.lpar%'
AND a.deleted = 0
ORDER BY node, lpar

b.lpars will commonly look like: "WIN1#WIN2#WIN3#WIN4#"
a.lpar will commonly look like: "WIN1"

When I run this query I get zero matches. What do I need to do to match fields using LIKE?

View Replies !
Comparing Two Table
I have two tables:

CREATE TABLE `FootballerScore` (
`footballerID` mediumint(4) NOT NULL default '0',
`GameWeekID` mediumint(4) NOT NULL default '0',
`GameRuleID` mediumint(4) NOT NULL default '0',
`Goals` mediumint(4) NOT NULL default '0',
`Assists` mediumint(4) NOT NULL default '0',
`CleanSheets` mediumint(4) NOT NULL default '0',
`YellCards` mediumint(4) NOT NULL default '0',
`RedCards` mediumint(4) NOT NULL default '0',
`WeeklyScore` mediumint(4) NOT NULL default '0',
`AccScore` mediumint(6) NOT NULL default '0',
PRIMARY KEY (`footballerID`,`GameWeekID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `footballers` (
`footballerID` mediumint(15) NOT NULL default '0',
`fname` varchar(15) collate latin1_general_ci NOT NULL default '',
`sname` varchar(15) collate latin1_general_ci NOT NULL default '',
`value` decimal(15,1) NOT NULL default '0.0',
`PremTeamID` mediumint(15) NOT NULL default '0',
`position` varchar(15) collate latin1_general_ci NOT NULL default '',
`Importance` varchar(4) collate latin1_general_ci NOT NULL default '',
PRIMARY KEY (`footballerID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

The footballers table basically has a list of all the players in the premiership and the footballerscore table has a list of the player who played in a given week. For any one week I need to find out who DIDNT play. I can do this by comparing all the footballerIDs in both tables and the difference is the group I need. However I'm not sure how to put this into an SQL statement.

View Replies !
Comparing A Csv To A Db Table
How would I go about comparing values in a CSV file to a table in the database, and then removing any rows where that value (an email address) matches? Is this something I can do in phpMySQL or will I need to create a separate PHP script or something?

I maintain a mailing list using something called ListMessenger. It's a great web application, but the one major drawback is that it doesn't have a way to handle bounces. Over the course of 5-6 years, I'm now up to around 800-900 bounced emails every time I send out a newsletter.

I'd really like to clean up the list and I was able to extract all the bounced address from my email client. I'm just not sure how to do it. I actually have an idea of what needs to be done... it's more the actual code to make it happen that I'm not sure of.

I'm thinking it would be something like this:

1. Open csv file and read values into an array
2. Run a SQL statement that removes any rows from the "users" table if the "email_address" field matches any of the addresses in the array.

Any help would be greatly appreciated. I can get into more specifics as far as the table/column names and stuff,

View Replies !
Comparing Tables
I have a query that produces a list of names of people who have completed a certain course. I want to be able to run a report which can show who has not completed this course. The code I have attached below just returns the same result as those who have sat the course....

View Replies !
Comparing Timestamps
My table keeps track of the last time a program was run and how often that program is supposed to be run.

I want to retrieve all the rows where the program is scheduled to run again: ... WHERE NOW() > (last_runtime + run_frequency)

last_runtime and run_frequency are both TIMESTAMP field types

Is there a way do this, or do I need to convert these fields into something other?

View Replies !
Comparing Hours In One Single Day
I have to write a program using PHP5 and mysql 5.0.51b thats found on the WAMP 2.2

The dilemma is the following:

I have 5 meeting rooms each one named c1,c2,c3 etc

How do make a table where I can reserve a room at a certain date and certain time? This is the table i have so far: ....

View Replies !
Comparing A Field With A String
I would like to run a select statement against a table, with a where condition that a field (less all it's non-alphanumeric chars) = a string. Ordering is important.

For example the following should all evalute true,
'1 2 3' = '123'
'1"2£3' = '123'
'1 23' = '123'
'(abcde)' = 'abcde'

where as these should evaluate false,
'123' != '321'
'1a23' != '123'
'abc' != abcd'

I have a sinking feeling I need regex for this, which is unfortunate as I know none.

View Replies !
Comparing Data From 3 Tables
I am trying to wrap my head around the sql statement needed to get the data I need by comparing three tables.
I have three tables: authors, submissions, and ratings.
I need to see all the submissions that a specific author has not rated.

In other words, I compare the submissions table to the ratings table and find instances where there is a submission but not a rating from a particular author (signified by the row rater_id)

I've tried different combinations of INNER and OUTER joins, unions, subqueries... and nothing is working for me.

View Replies !
Comparing Data In 2 Tables
I have a table of users which is updated once a week by the client sending me a spreadsheet, and me uploading the CSV to my scripts which then import the data into the user table. This all works fine. However instead of sending me incremental data that can be just imported, the client has now taken to sending me a complete data list. The problem with this is that I cannot just empty the user table and re-populate with the new data as I will lose the primary key values which I use elsewhere.

My solution to this was to create a new table for importing with the same structure as my user table, import the csv to there, then somehow compare the tables and add the rows missing from the import table into the user table.

My question then, is this possible using a SQL query. Can I compare 2 tables, and add missing data from 1 into the other as new records? I could code a software solution, but with around 30k records in the user table I think a SQL query would be the best approach.

View Replies !
Comparing Partial Strings
Suppose I have a varchar field "A" in my table that has a value '120 g'
I have a variable $weight=120;

Now I want to run a query which compares $weight to 120 of field A

Can I do that? I think I will have to extract the number from 120 G and then do the comparsion.or something like that/

View Replies !
Comparing Tables In Same Database
I have two tables on the same database:

hr_harassment (everybody who has already entered into a training class)
fields: lname, fname, class

hr_employee_list (everybody who needs to enter into a training class)
fields: Lname, Fname

I need to compare the two tables to figure out who has not yet signed up for the class. What would be the easiest way to do this? I am using PHP to program the page. I looked online and came up with this:

SELECT * FROM hr_employee_list AND NOT EXISTS (SELECT * FROM hr_harrassment AND hr_employee_list.Lname = hr_harrassment.lname AND hr_employee_list.Fname = hr_harrassment.fname)

But my browser tells me this:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in monitor.php on line 270

View Replies !
Comparing Tables With Mysql
I have 2 tables with the same format (same columns). Table 'a' is a subset of table' b'. I.e. in an ideal situation all entries in table 'a' should exist in table 'b'.
I can uniquely identify an entry using 3 fields (no SQL key is setup)

I need to write an SQL query (or a few queries) that will compare the 2 tables and output:
Records that are in A but not in B
Records that exists on both (i.e. key match) but are different (any other value but the key is different).

View Replies !
Comparing Multiple ID Fields
I have an advert table which contains three category ID fields (catid, catid2, catid3). These catid fields match up with the catid field in the category table. I want to run a query that returns any row that contains any mention of a specific category.

SELECT * FROM advert, category
WHERE advert.catid = category.catid
AND advert.catid = '3'

The above query works fine for the first advert.catid field, but once I introduce...:

OR advert.catid2 = '3'

... the results start getting strange. The same row is returned 9 times.

View Replies !
Comparing Entire Row And Inserting New Ones
I have a transaction table (T1) that is refreshed with transactions every day where I have bunch of information but the key fields are;
identifier, cost, retail, date

I have a limitation on T1 that I cannot have identifier as primary key since there are many transaction with same identifier, it is being sold multiple times.

I have a second table (T2) where I keep price updates. T2 has;
identifier(primary key), cost, retail, date

I am trying to find out if cost or retail is changing (my distributors have flexibility to change both in certain limits).

I want to update the T2 by inserting a new line when either cost or retail changes with timestamp so I can see trends on both.

View Replies !
Comparing Successive Rows
I'm having a table with the following (simplified) columns:

id (AUTO_INCREMENT), computer_id(INT), time (INT).

Every few seconds different computers are inserting a row with time being the time when this happened. Now I would like to generate a statistic that shows per computer when it happened that two insert operations were more than x seconds apart. This way I can e.g. see when a computer has had a little too much lag time.

If I only have one computer in my table this is quite straight forward:

SELECT t2.time-t1.time, FROM mytable t1 INNER JOIN mytable t2 ON t1.id=t2.id-1 AND t1.time<t2.time-x;

This quiery is based on the assumption that the IDs of two following entries from a computer are in order and e.g. 2 and 3 or 9 and 10. If however I have a few computers in the table the IDs for one computer aren't following each other anymore and could be 9, 17, 22, 23, 31 ...
I read something about have a sort of "on-the-fly" incremental id per computer using a variable:

SET @counter=0;SET @counter2=0;
SELECT t2.time-t1.time FROM (SELECT @counter:=@counter+1 as counter, time FROM mytable WHERE computer_id=1) AS t1 INNER JOIN (SELECT @counter2:=@counter2+1 as counter, time from mytable WHERE computer_id=1) AS t2 ON t1.counter=t2.counter-1 and t1.time<t2.time-x;

The sad news is that this query never returns, at least I didn't see it return. Generally I would say that having two sub-queries in there isn't the best thing to do, but I didn't know how to do it. I'm sure there is a way to do this without having a single table for each computer, but I just can't figure out how to do this.

Anybody with an idea?

View Replies !
Comparing DateTime Field To Now()
I am trying to have a select query which compares a Datetime field to the current date/time, Now(). Basically I want something to this effect:

SELECT Name FROM Lists WHERE expiration > 'Now()'

Expiration is a datetime field. The problem is It returns every name on the list except for ones with a value of 0000-00-00 00:00:00 whether or not the date has passed already. I have tried many other things including but not limited to

SELECT Name FROM Lists WHERE datediff(expiration,'Now()') > 0
SELECT Name FROM Lists WHERE timediff(expiration,'Now()') > 0
SELECT Name FROM Lists WHERE datediff('expiration','Now()') > '0'

and many other variations on those. The above 3 just returned a null recordset. How can I make this work?

View Replies !
Comparing Datetime And Time
I need to compare two values : the first one is in DATETIME format and the second one in TIME format. If I compare the two values with an usual operator, will MySQL extract the "time" part of the DATETIME and compare it to the TIME value?

If not, what function can I use to extract the "time" value? I have noticed the existence of TIME(expr) function, that extracts the TIME value from 'expr'... but it works only if 'expr' is a string, not a DATETIME.

View Replies !
Comparing String As Date
A client is using mysql 3.23 as database. He wants me to make a report where the dates are store in varchar columns. How do i convert string columns to date so i can made the ">" and "<" right??

View Replies !
Comparing Strings With Accents
I want to compare strings with a select command.
In two tables, there are strings with and whitout accents, like "Cecile" and "Cécile".

I don't know how I can get all the results for this kind of select :

select table1.givenname from table1,table2 where table1.givenname = table2.givename

I want to compare whitout accents but I don't know how to.

View Replies !
Comparing 2 Tables For Differences
Trying to seperate data differences between 2 tables. Lets say i have 2 tables like the following

tbl_1
int_id - str_name
1 - Bob
2 - Roger
3 - Kim
4 - Jane

tbl_2
int_id - str_name
1 - Bob
2 - John
3 - Kim
4 - George

How could i construct a query to get results of the differences? Like seeing what names are in tbl_2 that are not in tbl_1? Or what is not in tbl_2 that is in tbl_1?

View Replies !
Comparing An Entire Row To Match Exactly
is there any way in which a MySQL query can compare all the composite primary keys of one table with their relevant foreign keys in another table.

I need to creat a query which in english says:

"find all the rows in table one where the composite primary keys of that row do not exist in the exact instance, in table 2"

eg. 1, 2, 3 is in table one but 1, 2, 3 IS NOT in table two, therefore return the row from table one.

View Replies !
Comparing A Datetime Column
I am trying to write a query that will delete all rows that are older than a specified date.

The problem is that I am fairly new to mysql and that I am not quite sure about how I should compare something in the format yyyy-mm-dd hh:mm:ss.

Would converting that date format using UNIX_TIMESTAMP(), subtracting that from the current unix timestamp and then comparing be a good way to approach this problem?

Or are there other functions that may be easier to use?

Also, on a curious note.. how portable are these built-in mysql functions to other SQL software packages?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved