|
-
Jul 12th, 2000, 03:07 AM
#1
Thread Starter
Addicted Member
How do you implement the DateDiff and DateAdd commands in Access 97?
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 12th, 2000, 03:14 AM
#2
Fanatic Member
Hi Harrild
Do you mean in VBA for access or in SQL
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 12th, 2000, 03:31 AM
#3
Thread Starter
Addicted Member
A SQL would be good plz...
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 12th, 2000, 03:37 AM
#4
Fanatic Member
Try this for size
SELECT DATEDIFF(day, date1, column1) AS no_of_days
FROM table1
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 12th, 2000, 10:12 PM
#5
Thread Starter
Addicted Member
Ok its a start but i want the date fidd between todays date and the one in the column...
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 13th, 2000, 03:16 AM
#6
Fanatic Member
Hi
In that case use
SELECT DATEDIFF(day, getDate(), column1) AS no_of_days
FROM table1
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 14th, 2000, 06:48 PM
#7
Thread Starter
Addicted Member
huh?
I still have no idea on how to use it.....what are 'day', 'getdate()' and 'column1'?
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 17th, 2000, 02:57 AM
#8
Fanatic Member
Hi harry
Sorry about he delay in reurning bit iv'e been away for the weekend
The datediff function returns the difference in the specified format between two dates. Datediff(datepart,date1,date2). SO in the example I gave you it would return a column called no_of_days consisting of the number of days between today (getdate()) and whatever date that would be in column1.
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 20th, 2000, 09:50 PM
#9
Thread Starter
Addicted Member
And where do i enter that then?
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 20th, 2000, 10:47 PM
#10
Thread Starter
Addicted Member
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 21st, 2000, 02:13 AM
#11
Fanatic Member
Do You mean you want to check a date in VBA, or you want to return Something in a recordset using the datediff in SQL?
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 24th, 2000, 04:07 AM
#12
Thread Starter
Addicted Member
i got DateAddn in VBA for a form and i want the DateDiff in VBA so i can use it with a form
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 24th, 2000, 04:19 AM
#13
Fanatic Member
In VBA,
all you need to do is the following
Dim intDifferenceinDays as integer
intDifferenceinDays = DateDiff("d",now(),somedate)
That will return the difference in days between today(now()) And what ever date you put in the second part.
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 24th, 2000, 04:27 AM
#14
Thread Starter
Addicted Member
could i out
intDifferenceinDays = DateDiff("d",now(), columname)
cos the diff is from todays date and the other column's date, which in turn gets its value from another column using DateAdd
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 24th, 2000, 04:31 AM
#15
Fanatic Member
What do you mean by could i out ?
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 24th, 2000, 04:46 AM
#16
Thread Starter
Addicted Member
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 24th, 2000, 05:31 AM
#17
Fanatic Member
Yes you can
There is no reason wht you can't put a DateAdd inside a DateDiff
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 24th, 2000, 05:35 AM
#18
Thread Starter
Addicted Member
maybe you missunderstood
can i put a column name in place of somedate()?
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
-
Jul 24th, 2000, 05:40 AM
#19
Fanatic Member
Yes you can
Code:
intDifferenceinDays = DateDiff("d",now(), myrecordset("Mydatecolumn"))
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 24th, 2000, 05:54 AM
#20
Thread Starter
Addicted Member
thanks i let you know how it goes in about 12-24hrs cos the DB is at school at the mo
Reality is an illusion caused by by lack of drugs
Is this real or am i just having a dream?
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
|