|
 |
asp_web_howto thread: Compare Dates
Message #1 by "Nigel" <nigel@m...> on Mon, 22 Apr 2002 13:21:33 +0100
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C1EA00.9F74B510
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi quite new to asp ..
Can anyone help me I please. I have a field in my DB that is Date if
this date is (example) yesterday i Want it to display image1 else display
Image 2
The date in the DB is UK Date..
Here is the code
If objRSTemp("start_dt") < Now Then
.... Display iamge 1
Else
..Display image 2
End if
Hope someone can help .. much appreciated :)
Thanx
Message #2 by "Debreceni, David" <david_debreceni@r...> on Mon, 22 Apr 2002 09:08:40 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1E9FE.D22FAF70
Content-Type: text/plain;
charset="iso-8859-1"
use datediff
if datediff("d",objRSTemp("start_dt"), now) = 1 then
that will give you yesterday. hope that helps
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Nigel [mailto:nigel@m...]
Sent: Monday, April 22, 2002 8:22 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Compare Dates
Hi quite new to asp ..
Can anyone help me I please. I have a field in my DB that is Date if
this date is (example) yesterday i Want it to display image1 else display
Image 2
The date in the DB is UK Date..
Here is the code
If objRSTemp("start_dt") < Now Then
.... Display iamge 1
Else
..Display image 2
End if
Hope someone can help .. much appreciated :)
Thanx
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
Message #3 by "Nigel" <nigel@m...> on Mon, 22 Apr 2002 14:23:16 +0100
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_001C_01C1EA09.3E9B60A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Cheers...
I dont think i explained well enough .. (sorry )
Basically Im modifying a calender script.
I want this script to display any events on a cetain day.. (this i got
working no probs) but if the event has passed i want it to display i
different image to the event that hasnt happened yet..
-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: 22 April 2002 14:09
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Compare Dates
use datediff
if datediff("d",objRSTemp("start_dt"), now) = 1 then
that will give you yesterday. hope that helps
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Nigel [mailto:nigel@m...]
Sent: Monday, April 22, 2002 8:22 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Compare Dates
Hi quite new to asp ..
Can anyone help me I please. I have a field in my DB that is Date
if this date is (example) yesterday i Want it to display image1 else display
Image 2
The date in the DB is UK Date..
Here is the code
If objRSTemp("start_dt") < Now Then
.... Display iamge 1
Else
..Display image 2
End if
Hope someone can help .. much appreciated :)
Thanx
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
Message #4 by "Debreceni, David" <david_debreceni@r...> on Mon, 22 Apr 2002 09:43:19 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1EA03.A9840E90
Content-Type: text/plain;
charset="iso-8859-1"
I am not sure I understand, but if you just want to check and see if the
date in the database is in the past then you can still use datediff, just
use something like datediff("d",objRSTemp("start_dt"), now) > 0 that will
give you a true value for any date in the past.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
Message #5 by "Nigel" <nigel@m...> on Mon, 22 Apr 2002 15:07:58 +0100
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0024_01C1EA0F.7D12AEF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Cheers David I now understand ..
Worked Spot On !!
Thanx for the help
-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: 22 April 2002 14:43
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Compare Dates
I am not sure I understand, but if you just want to check and see if the
date in the database is in the past then you can still use datediff, just
use something like datediff("d",objRSTemp("start_dt"), now) > 0 that will
give you a true value for any date in the past.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
|
|
 |