473,320 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

IF statement regarding dates

Hello guys ..

my qustion is
i have table in the database that have these two information
The_date (in type Date)
The_time (type_time)
here is simple data in this table
the_date = 2005-08-20
The_time = 15:00:00
what i need is simple if statement that compair the Server Time and
date with this time and date .. and if the server time and date pass
this time it will set value (X) to (false)
example
today is 7-06-2006 and lets say time is 15:00:00
in the database the date is
7-06-2006 and time are (14:59:00)
in this case it will give me True
other example
today is 7-06-2006 and lets say time is 15:00:00
in the database the date is
6-06-2006 and time are (14:00:00)
it will give me false becouse it pass this time
i hope i was clear
thanks

Jun 7 '06 #1
3 1558
i love PHP wrote:
i have table in the database that have these two information
The_date (in type Date)
The_time (type_time)

what i need is simple if statement that compair the Server Time and
date with this time and date .. and if the server time and date pass
this time it will set value (X) to (false)


Thanks for all the whitespace ilP, I was running out. You might love PHP but
this is OT - you should be doing it in ${the database language of your
choice}

C.
Jun 7 '06 #2
Carved in mystic runes upon the very living rock, the last words of i
love PHP of comp.lang.php make plain:
i have table in the database that have these two information

The_date (in type Date)
The_time (type_time)

what i need is simple if statement that compair the Server Time and
date with this time and date .. and if the server time and date pass
this time it will set value (X) to (false)


$dbTime = strtotime("$The_date $The_time");

if ($dbTime < time()) {
}
else {
}

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jun 7 '06 #3
Carved in mystic runes upon the very living rock, the last words of
Colin McKinnon of comp.lang.php make plain:
i love PHP wrote:
i have table in the database that have these two information
The_date (in type Date)
The_time (type_time)

what i need is simple if statement that compair the Server Time and
date with this time and date .. and if the server time and date pass
this time it will set value (X) to (false)


Thanks for all the whitespace ilP, I was running out. You might love
PHP but this is OT - you should be doing it in ${the database language
of your choice}


Heh? Why can't he do it in PHP? If you don't know the answer, are you
just posting to admire your own cleverness?

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jun 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: J. Muenchbourg | last post by:
I would like to grab the earliest date of any of the records that gets drawn from this SQL statement: datesql = "SELECT top 1 gamedate FROM tblNFLGameData WHERE season = '" & seasonZ & "' and...
5
by: Jeremy | last post by:
I am relatively inexperienced with SQL, and I am trying to learn how to analyze some data with it. I have a table with the following information. COMPANY ID , DATE, MarektValue I would like...
2
by: David | last post by:
Hi, I have part of my SQL statement in my asp page as follows: WHERE ((pcbforecast.ShipETA < '31/12/2005') and (products.BBProductName = ....... The problem I am having is that I want the...
35
by: Thomas Matthews | last post by:
Hi, My son is writing a program to move a character. He is using the numbers on the keypad to indicate the direction of movement: 7 8 9 4 5 6 1 2 3 Each number has a direction except...
3
by: Chris | last post by:
Hi guys, I am having some difficulties making a sql-statement. I took the Northwind database as an example. I want to return the customernumbers from the orders-table, where the orderdate is...
3
by: Andy_Khosravi | last post by:
I have been trying to build a user friendly search engine for a small database I have created. I'm having some particular problems with one of my date fields. Here's the setup: I'm using...
14
by: Siv | last post by:
Hi, I just discovered that if in an ADO.NET query I use: "Select * from Invoices Where InvoiceDate BETWEEN StartDate AND EndDate;" In this case StartDate would be 1st of month and EndDate...
5
by: Henry | last post by:
Dear all, Is there any DB2 SQL statement that could generate rows of intermediate dates by providing the start and end dates?? If 2006-1-1 and 2006-1-31 are provided to the SQL, the output...
3
by: jed | last post by:
string selectstr = "SELECT SUM(hrs) AS total_hours,SUM(mins)AS total_mins FROM Timerecords WHERE (workdate >='" + Convert.ToDateTime(dateTimePickerfirst.Text) + "')AND (workdate<='" +...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.