A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date format in design



 
 
Thread Tools Display Modes
  #1  
Old May 31st, 2009, 11:36 PM posted to microsoft.public.access.tablesdbdesign
acss
external usenet poster
 
Posts: 153
Default Date format in design

I am creating a DB to track invoices and in the future i would like to run
queiries or reports that would separate invoices from one month to the other.
For instance, run a report that would group invoices dated within the month
of april and group invoices within the month of may. Should i be using date
format 00/00/0000 for this function?
  #3  
Old June 1st, 2009, 01:14 AM posted to microsoft.public.access.tablesdbdesign
acss
external usenet poster
 
Posts: 153
Default Date format in design

Let me be more specific. In order to run dates from one month against another
month, what format should the data entry be used ?

00/00/0000---can this format be keyed into the date field so groupings can
be done per month?

Thanks

"Steve" wrote:

You can use the Month function. For ex, Month([InvoiceDate]).

Steve




"acss" wrote in message
...
I am creating a DB to track invoices and in the future i would like to run
queiries or reports that would separate invoices from one month to the
other.
For instance, run a report that would group invoices dated within the
month
of april and group invoices within the month of may. Should i be using
date
format 00/00/0000 for this function?




  #4  
Old June 1st, 2009, 01:20 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Date format in design

On Sun, 31 May 2009 15:36:01 -0700, acss wrote:

I am creating a DB to track invoices and in the future i would like to run
queiries or reports that would separate invoices from one month to the other.
For instance, run a report that would group invoices dated within the month
of april and group invoices within the month of may. Should i be using date
format 00/00/0000 for this function?


The date format is irrelevant in this issue. A Date/Time field is not stored
in any particular format; instead it's stored as a double float count of days
and fractions of a day (times) since midnight, December 30, 1899:

?now; cdbl(now)
5/31/2009 6:18:51 PM 39964.7630902778

You can use the builtin Access functions such as Month([InvoiceDate]) to
extract just the month, or use a Totals query grouping by an expression like

InvMonth: Format([InvoiceDate], "yyyy-mm")

to get a text string such as 2008-12, 2009-01, 2009-02 which will sort
chronologically and let you group by month.
--

John W. Vinson [MVP]
  #6  
Old June 1st, 2009, 01:37 AM posted to microsoft.public.access.tablesdbdesign
acss
external usenet poster
 
Posts: 153
Default Date format in design

Thanks John. What i am trying to accomplish is the separate the invoices that
were from last month from this current month so i know which month charges
were incurred. Using the string in query "yyyy-mm" is it possable for results
to show as day mnth year?

"John W. Vinson" wrote:

On Sun, 31 May 2009 15:36:01 -0700, acss wrote:

I am creating a DB to track invoices and in the future i would like to run
queiries or reports that would separate invoices from one month to the other.
For instance, run a report that would group invoices dated within the month
of april and group invoices within the month of may. Should i be using date
format 00/00/0000 for this function?


The date format is irrelevant in this issue. A Date/Time field is not stored
in any particular format; instead it's stored as a double float count of days
and fractions of a day (times) since midnight, December 30, 1899:

?now; cdbl(now)
5/31/2009 6:18:51 PM 39964.7630902778

You can use the builtin Access functions such as Month([InvoiceDate]) to
extract just the month, or use a Totals query grouping by an expression like

InvMonth: Format([InvoiceDate], "yyyy-mm")

to get a text string such as 2008-12, 2009-01, 2009-02 which will sort
chronologically and let you group by month.
--

John W. Vinson [MVP]

  #7  
Old June 1st, 2009, 02:53 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Date format in design

On Sun, 31 May 2009 17:37:01 -0700, acss wrote:

Thanks John. What i am trying to accomplish is the separate the invoices that
were from last month from this current month so i know which month charges
were incurred. Using the string in query "yyyy-mm" is it possable for results
to show as day mnth year?


Again:

The format of the date field in the table
IS ABSOLUTELY IRRELEVANT.
It does not come into the problem.

You can use a criterion

= DateSerial([Enter year:], [Enter month number:], 1) AND DateSerial([Enter year:], [Enter month number:] + 1, 1)


There are some other possible options, such as using a Calendar control on a
form. Depends on how your user interface is set up.
--

John W. Vinson [MVP]
 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.