PC Review


Reply
Thread Tools Rate Thread

Allen Browne's Calendar Date/Time & Minutes

 
 
Beeyen
Guest
Posts: n/a
 
      10th Apr 2009
Good Day,

I am using the Pop-up calendar, which was so gracously provided by Mr
Browne. But I would like to add the current day and time with the date , if
possible when the date is selected. Assuming it is OK, Would anyone know how
this can be accomplished in the Calendar Design form.

Thanks

 
Reply With Quote
 
 
 
 
Graham Mandeno
Guest
Posts: n/a
 
      11th Apr 2009
Hi Beeyen

You can simply add a pure time value (no date) to a pure date value (no
time) to give you the time of day on the given date.

It helps to know how date/time values are represented internally. They are
stored as a 64-bit floating-point number (same as a Double), where the
integer part represents the date and the fractional part represents the time
(as a fraction of 24 hours).

The integer date is the number of days after 30-Dec-1899 (or before, if it
is negative).

For example, 3.25 is 6am on 2-Jan-1900, because 2-Jan-1900 is 3 days after
30-Dec-1899, and 0.25 of 24 hours is 6 hours - hence 6am.

(You can verify this by typing ?CDate(3.25) into the immediate window.)

So given any date value (which could be a date returned from Allen's
calendar) you can add a time value to it. Assuming you have a Date variable
named "dt" which currently holds the value 30-Mar-2009, you could add the
time in a number of ways. For example:

dt + TimeValue("9:25 pm") - gives 30-Mar-2009 9:25:00 pm
dt + TimeSerial(21, 25, 0) - same result
dt + Time - gives the current time on 30-Mar-2009
dt + TimeValue(Now) - same result

Note that you can ensure you have a "pure" date or time value by using the
DateValue or TimeValue functions. DateValue will remove any time component
and TimeValue will remove any date component.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Beeyen" <(E-Mail Removed)> wrote in message
news:6A095EB5-FC2F-4630-A48D-(E-Mail Removed)...
> Good Day,
>
> I am using the Pop-up calendar, which was so gracously provided by Mr
> Browne. But I would like to add the current day and time with the date ,
> if
> possible when the date is selected. Assuming it is OK, Would anyone know
> how
> this can be accomplished in the Calendar Design form.
>
> Thanks
>



 
Reply With Quote
 
Beeyen
Guest
Posts: n/a
 
      11th Apr 2009
Good Day Mr Graham Mandeno,

Thank you for responding. While the message you present is clear, I am not
certain where within the design of the calendar the date and time should be
entered. I have tried a number of entries, including changing the format
field properties and when I select the day on the popup calendar the results
are the same. Can you assist?

Let me know

Thanks

"Graham Mandeno" wrote:

> Hi Beeyen
>
> You can simply add a pure time value (no date) to a pure date value (no
> time) to give you the time of day on the given date.
>
> It helps to know how date/time values are represented internally. They are
> stored as a 64-bit floating-point number (same as a Double), where the
> integer part represents the date and the fractional part represents the time
> (as a fraction of 24 hours).
>
> The integer date is the number of days after 30-Dec-1899 (or before, if it
> is negative).
>
> For example, 3.25 is 6am on 2-Jan-1900, because 2-Jan-1900 is 3 days after
> 30-Dec-1899, and 0.25 of 24 hours is 6 hours - hence 6am.
>
> (You can verify this by typing ?CDate(3.25) into the immediate window.)
>
> So given any date value (which could be a date returned from Allen's
> calendar) you can add a time value to it. Assuming you have a Date variable
> named "dt" which currently holds the value 30-Mar-2009, you could add the
> time in a number of ways. For example:
>
> dt + TimeValue("9:25 pm") - gives 30-Mar-2009 9:25:00 pm
> dt + TimeSerial(21, 25, 0) - same result
> dt + Time - gives the current time on 30-Mar-2009
> dt + TimeValue(Now) - same result
>
> Note that you can ensure you have a "pure" date or time value by using the
> DateValue or TimeValue functions. DateValue will remove any time component
> and TimeValue will remove any date component.
> --
> Good Luck :-)
>
> Graham Mandeno [Access MVP]
> Auckland, New Zealand
>
> "Beeyen" <(E-Mail Removed)> wrote in message
> news:6A095EB5-FC2F-4630-A48D-(E-Mail Removed)...
> > Good Day,
> >
> > I am using the Pop-up calendar, which was so gracously provided by Mr
> > Browne. But I would like to add the current day and time with the date ,
> > if
> > possible when the date is selected. Assuming it is OK, Would anyone know
> > how
> > this can be accomplished in the Calendar Design form.
> >
> > Thanks
> >

>
>
>

 
Reply With Quote
 
Graham Mandeno
Guest
Posts: n/a
 
      12th Apr 2009
Hi Beeyen

If I understood your first question correctly, you wish the result from the
popup calendar to show not only the date, but also a time.

To do this, you would display the calendar first, then store the selected
date in a variable and then add the time to it.

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Beeyen" <(E-Mail Removed)> wrote in message
news:A6793A88-FED8-4E65-B8FC-(E-Mail Removed)...
> Good Day Mr Graham Mandeno,
>
> Thank you for responding. While the message you present is clear, I am
> not
> certain where within the design of the calendar the date and time should
> be
> entered. I have tried a number of entries, including changing the format
> field properties and when I select the day on the popup calendar the
> results
> are the same. Can you assist?
>
> Let me know
>
> Thanks
>
> "Graham Mandeno" wrote:
>
>> Hi Beeyen
>>
>> You can simply add a pure time value (no date) to a pure date value (no
>> time) to give you the time of day on the given date.
>>
>> It helps to know how date/time values are represented internally. They
>> are
>> stored as a 64-bit floating-point number (same as a Double), where the
>> integer part represents the date and the fractional part represents the
>> time
>> (as a fraction of 24 hours).
>>
>> The integer date is the number of days after 30-Dec-1899 (or before, if
>> it
>> is negative).
>>
>> For example, 3.25 is 6am on 2-Jan-1900, because 2-Jan-1900 is 3 days
>> after
>> 30-Dec-1899, and 0.25 of 24 hours is 6 hours - hence 6am.
>>
>> (You can verify this by typing ?CDate(3.25) into the immediate window.)
>>
>> So given any date value (which could be a date returned from Allen's
>> calendar) you can add a time value to it. Assuming you have a Date
>> variable
>> named "dt" which currently holds the value 30-Mar-2009, you could add the
>> time in a number of ways. For example:
>>
>> dt + TimeValue("9:25 pm") - gives 30-Mar-2009 9:25:00 pm
>> dt + TimeSerial(21, 25, 0) - same result
>> dt + Time - gives the current time on 30-Mar-2009
>> dt + TimeValue(Now) - same result
>>
>> Note that you can ensure you have a "pure" date or time value by using
>> the
>> DateValue or TimeValue functions. DateValue will remove any time
>> component
>> and TimeValue will remove any date component.
>> --
>> Good Luck :-)
>>
>> Graham Mandeno [Access MVP]
>> Auckland, New Zealand
>>
>> "Beeyen" <(E-Mail Removed)> wrote in message
>> news:6A095EB5-FC2F-4630-A48D-(E-Mail Removed)...
>> > Good Day,
>> >
>> > I am using the Pop-up calendar, which was so gracously provided by Mr
>> > Browne. But I would like to add the current day and time with the date
>> > ,
>> > if
>> > possible when the date is selected. Assuming it is OK, Would anyone
>> > know
>> > how
>> > this can be accomplished in the Calendar Design form.
>> >
>> > Thanks
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allen Browne Calendar Jim L. Microsoft Access 5 10th Jul 2009 05:39 PM
Allen Browne's Calendar PPCO Microsoft Access 1 17th Jun 2009 02:39 AM
Time to Allen Browne' calendar Beeyen Microsoft Access Database Table Design 3 14th Apr 2009 03:52 AM
Allen Browne Calendar Bob Vance Microsoft Access 2 23rd Oct 2008 02:11 AM
Allen Browne Popup Calendar - Calendar Button Problem =?Utf-8?B?Sm9hbk9D?= Microsoft Access 6 7th Feb 2006 12:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 AM.