|
-
Nov 14th, 2002, 04:05 PM
#1
Thread Starter
Fanatic Member
Here I go again........
DATE frickin DATE!
How do I [SELECT] from a database which contains dates starting from a year back from todays date.
The date format I'm using is 11/01/2002
Thx
-
Nov 14th, 2002, 04:15 PM
#2
PowerPoster
Oh, common. There is nothing to complaint about:
VB Code:
Private Sub Form_Load()
If DateDiff("yyyy", "11/01/2001", "11/01/2002") = 1 Then
MsgBox "This is just fine. ;-)"
End If
End Sub
-
Nov 14th, 2002, 04:17 PM
#3
PowerPoster
Another variation:
VB Code:
Private Sub Form_Load()
If Year("11/01/2002") - Year("11/01/2001") = 1 Then
MsgBox "I will be just fine. ;-)"
End If
End Sub
-
Nov 14th, 2002, 04:22 PM
#4
Addicted Member
Ummmmm.....
VB Code:
Dim dNow as Date
dNow = DateAdd("yyyy",-1, Date)
SELECT whatever FROM wherever WHERE [DateField] => " & dNow
Yes? No?
Some days you're the dog,
and some days you're the hydrant.
VB6 Enterprise
-
Nov 14th, 2002, 04:23 PM
#5
Thread Starter
Fanatic Member
Sorry IROY55 didn't explain myself again!
Im using Data1.Recor....Select From.....etc. etc.... order by date
Ive put the date to search into a text box by using [Date - 365] I think that is causing the problem as its not selecting dates over a year. More like 1 year and a couple of months...
I think we have been here before IROY55
-
Nov 14th, 2002, 04:24 PM
#6
PowerPoster
-
Nov 14th, 2002, 04:25 PM
#7
Thread Starter
Fanatic Member
PhilRob56 I think you could be onto somthing there...
Thx
-
Nov 14th, 2002, 04:29 PM
#8
Thread Starter
Fanatic Member
Thx Roy & PhilRob56 I'll go and try it.
-
Nov 14th, 2002, 04:34 PM
#9
Frenzied Member
you could do this..
select [value] from [value]
with recordset
if!datexxx <= maxdate and !date >= mindate then add to list
end with
kinda sloppy, but you get teh drift - right?
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Nov 14th, 2002, 04:36 PM
#10
Thread Starter
Fanatic Member
yup
-
Nov 14th, 2002, 05:01 PM
#11
Addicted Member
Good Luck!
Some days you're the dog,
and some days you're the hydrant.
VB6 Enterprise
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|