Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2003, 02:57 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert date format

Hi,

I remember there is a command that convert a data format "date" to number value but I not remember the command line.
What's the command?

2) I've necessity to calculate a difference between two dates.
How can I do it?

Thank you!!!
Bye!
 
Old June 18th, 2003, 03:09 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to psychadelic
Default


Tada! : DateDiff("d", Date1, Date2)


cheers
 
Old June 18th, 2003, 03:40 AM
Authorized User
 
Join Date: Jun 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK!!! :D it works but if there is a singolary date that i do not have to calculate ?

Example:
23/12/2003 All
24/12/2003 All
25/12/2003 only from 5.00 to 7.00
26/12/2003 All

Thank you!
 
Old June 18th, 2003, 04:42 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to psychadelic
Default

The datediff function will always return a number of time intervals between two specified dates. You can change the type of intervals if you want.

DateDiff(interval, date1, date2) where interval can be :

yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second

Bye





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 03:17 PM
how can i convert date into format '2007-10-25T11: vishnu108mishra C# 2 November 23rd, 2007 04:45 AM
Converting date to yy.mm.dd format using CONVERT Jinn SQL Server 2000 6 October 14th, 2006 06:44 PM
XSLT - Convert the date in different format haixia XSLT 1 August 25th, 2006 11:51 AM
Formula to convert date format narooma.12 Crystal Reports 0 April 20th, 2005 04:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.