|
![]() |
|
| Author |
|
|||||||
|
diese1
Posts: 137
Location: Brisbane, Queensland
|
For some odd reason i can't seem to compare dates with operators less than or equal to etc.
See line of code below: dim offCycleEndDate If Date < 14 / 2 / 2008 Then If Date > 30 / 1 / 2008 Then offCycleEndDate = "717" End If End If Even though todays date is the 13th it still doesn't go through the IF statemnet. Help someone? |
|||||||
| #0 02:18pm 13/02/08 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
Opec
Posts: 4929
Location: Brisbane, Queensland
|
||||||||
| #1 02:25pm 13/02/08 |
|
|||||||
|
Jim
Posts: 7339
Location: Brisbane, Queensland
|
I don't know anything about vb, but is that unquoted string seriously the format you can use for a date comparison?
and if your intention is definitely to find dates between 30/01/08 and 14/2/08 wouldn't you just use a single if statement? |
|||||||
| #2 02:28pm 13/02/08 |
|
|||||||
|
diese1
Posts: 138
Location: Brisbane, Queensland
|
cool thx, using the Datediff function now
|
|||||||
| #3 02:35pm 13/02/08 |
|
|||||||
|
Hogfather
Posts: 1578
Location: Cairns, Queensland
|
Dear world,
Please let VBScript die already. TIA, Us. |
|||||||
| #4 03:55pm 13/02/08 |
|
|||||||
|
mooby
Posts: 3840
Location: UK
|
my tips for dates.
always use iso 8601 yyyy-mm-dd. saves alot of headaches if you use sql server. |
|||||||
| #5 10:01pm 13/02/08 |
|
|||||||
|
mooby
Posts: 3841
Location: UK
|
I don't know anything about vb, but is that unquoted string seriously the format you can use for a date comparison? use #2008/01/02# |
|||||||
| #6 10:02pm 13/02/08 |
|
|||||||
|
system
|
--
|
|||||||
| #6 |
|
|||||||
|
| ||||||||