dbTalk Databases Forums  

Date Partition Function

comp.databases.ms-access comp.databases.ms-access


Discuss Date Partition Function in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Craig
 
Posts: n/a

Default Date Partition Function - 04-13-2010 , 12:23 PM






I have a circumstance where I need to calculate counts based on user
set start times, end times, and intervals. It looks like the
partition function (http://office.microsoft.com/en-us/access/
HA012288921033.aspx) would do exactly that but it requires whole
numbers not dates. SO......

1) Is there a partition function based on dates?
2) Is there a way to convert dates to numbers to use the function?
3) Is there another way to get the same sort of effect as the
partition function?

Reply With Quote
  #2  
Old   
Bob Quintal
 
Posts: n/a

Default Re: Date Partition Function - 04-13-2010 , 04:42 PM






Craig <cjohns38 (AT) gmail (DOT) com> wrote in
news:400494cd-4af5-4941-855f-063647e15055 (AT) i37g2000yqn (DOT) googlegroups.co
m:

Quote:
I have a circumstance where I need to calculate counts based on
user set start times, end times, and intervals. It looks like the
partition function (http://office.microsoft.com/en-us/access/
HA012288921033.aspx) would do exactly that but it requires whole
numbers not dates. SO......

1) Is there a partition function based on dates?
2) Is there a way to convert dates to numbers to use the function?
3) Is there another way to get the same sort of effect as the
partition function?

Dates or date/times?

date/times are stored in Access tables as the number of days since
December 31st, 1899, with the time as a fraction of a day.

You could therefore convert today to a long integer using
clng(date()) which is day 40281

You could alternatively use several of the date functions to get the
specified interval I regularly run a totals query by month using the
datepart("yyyy",[dt_created])*100+datepart("ww",[dt_created]) in a
totals query to return the count of records added each week



--
Bob Quintal

PA is y I've altered my email address.

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.