#### Date expressions - help appreciated!!!

```Hello

I am just wondering if there is an easy way that an expression can be used
to calculate the number of days in a month?

Any assistance would be greatly appreciated

Thank you in advance

AC
```
 0
Utf
10/24/2007 1:42:01 AM
access 16762 articles. 3 followers.

3 Replies
621 Views

Similar Articles

[PageSpeed] 22

```well, the number of days in a month can change - specifically, the number of
days in February, depending on what year it is. for the number of days in a
*specific month of a specific year*, the following will work, as

Public Function isDaysCount(ByVal dat As Date) As Integer

Dim dat2 As Date

dat2 = DateAdd("m", 1, dat)

isDaysCount = DateDiff("d", DateSerial(Year(dat), Month(dat), 1), _
DateSerial(Year(dat2), Month(dat2), 1))

End Function

the function requires a complete date (month, day, year) for its' argument.

hth

"ac512" <ac512@discussions.microsoft.com> wrote in message
news:482A7C05-951A-4C65-82F4-CE9524CF29AC@microsoft.com...
> Hello
>
> I am just wondering if there is an easy way that an expression can be used
> to calculate the number of days in a month?
>
> Any assistance would be greatly appreciated
>
> Thank you in advance
>
> AC

```
 0
tina
10/24/2007 3:03:08 AM
```Thanks very much for your assistance Tina

much appreciated

Kind regards
AC

"tina" wrote:

> well, the number of days in a month can change - specifically, the number of
> days in February, depending on what year it is. for the number of days in a
> *specific month of a specific year*, the following will work, as
>
> Public Function isDaysCount(ByVal dat As Date) As Integer
>
>     Dim dat2 As Date
>
>     dat2 = DateAdd("m", 1, dat)
>
>     isDaysCount = DateDiff("d", DateSerial(Year(dat), Month(dat), 1), _
>         DateSerial(Year(dat2), Month(dat2), 1))
>
> End Function
>
> the function requires a complete date (month, day, year) for its' argument.
>
> hth
>
>
> "ac512" <ac512@discussions.microsoft.com> wrote in message
> news:482A7C05-951A-4C65-82F4-CE9524CF29AC@microsoft.com...
> > Hello
> >
> > I am just wondering if there is an easy way that an expression can be used
> > to calculate the number of days in a month?
> >
> > Any assistance would be greatly appreciated
> >
> > Thank you in advance
> >
> > AC
>
>
>
```
 0
Utf
10/24/2007 3:18:01 AM
```you're welcome; hope it helps or at least gives you some ideas that may be
useful.  :)

"ac512" <ac512@discussions.microsoft.com> wrote in message
news:AAE78F5F-EDA2-4D21-A715-83A496A982D2@microsoft.com...
> Thanks very much for your assistance Tina
>
> much appreciated
>
> Kind regards
> AC
>
> "tina" wrote:
>
> > well, the number of days in a month can change - specifically, the
number of
> > days in February, depending on what year it is. for the number of days
in a
> > *specific month of a specific year*, the following will work, as
> >
> > Public Function isDaysCount(ByVal dat As Date) As Integer
> >
> >     Dim dat2 As Date
> >
> >     dat2 = DateAdd("m", 1, dat)
> >
> >     isDaysCount = DateDiff("d", DateSerial(Year(dat), Month(dat), 1), _
> >         DateSerial(Year(dat2), Month(dat2), 1))
> >
> > End Function
> >
> > the function requires a complete date (month, day, year) for its'
argument.
> >
> > hth
> >
> >
> > "ac512" <ac512@discussions.microsoft.com> wrote in message
> > news:482A7C05-951A-4C65-82F4-CE9524CF29AC@microsoft.com...
> > > Hello
> > >
> > > I am just wondering if there is an easy way that an expression can be
used
> > > to calculate the number of days in a month?
> > >
> > > Any assistance would be greatly appreciated
> > >
> > > Thank you in advance
> > >
> > > AC
> >
> >
> >

```
 0
tina
10/25/2007 3:47:03 AM

Similar Artilces:

whats the web address for outlook so i can sign on? I have it stored on my home computer but dont have it here thanks Outlook doesn't have a web address unless you use an Exchange server. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com <anonymous@discussions.microsoft.com> wrote in message news:64da01c3e61b\$58282fc0\$a401280a@phx.gbl... > whats the web address for outlook...

help installing exchange 2000 in one of 3 sites
I have a domain cotoso.com installed and configured as AD for 3 companies interlinked together. and + a total of 3 DC in 3 different sites that are connected by VPN. i have exchange installed in each site connected on the same domain contoso.Local(+ E-mail -->contoso.com) + hosting their own companie domain name such as x.com or y.co or z.com for each company. I have a routing link configured + 3 administrative groups in exchange system manger for each company. one DC in one site that also has exchange 2000 installed on it has to be changed because of poor performance. now i'm ...

HELP!! Viewing email images
I have just recently switched to using Outlook rather than Outlook Express as my email program. I now find that any image attachments (.jpg, .bmp etc.) I receive are not visible onscreen as they used to be in Outlook Express. I have to click on each attachment icon to view... It's annoying, especially if I get a series of pics...I have to manually ope each one... Does anyone know how to set Outlook so that it shows me these images onscreen??? Many Thanks, Darren. ...

Need help getting this code to compile under VS.NET 2003 (compiles under VS6.0).
I'm tasked with converting a LARGE project from VS6.0 to VS.NET 2003. Here is a VERY scaled down version of an error I'm getting. I must be getting rusty, but the way to get around this compiler error is just not coming to me. If you need to compile this, just create a Win32 console app and specify to add support for MFC, then copy this code into the cpp file and press compile. class CLogItem : public CObject { protected: virtual BOOL CheckConflict(CLogItem* pItem) const; }; struct MapEntry; //forward declaration.. typedef CArray<MapEntry, MapEntry&> CMapEntryArray;...

help!! smtp protocol error occurred
exchange 2000 srv/windows 2k srv smtp protocol error occurred when trying to send mails. receives fine. Still waiting for some relavent information so we can help you solve your problem. >-----Original Message----- >exchange 2000 srv/windows 2k srv >smtp protocol error occurred when trying to send mails. >receives fine. > > >. > I had that problem, I telneted into the servers that the error occurred and found I was on a blacklist. Had to sumit to an open relay test, and bam, no more problems. ...

Help !!!!
I was migration my Exchange 2000 to 2003 I do my forest prep and domain prep But i can't create mailboxes ??? Why??? some documentation please... What actually happens? What error do you get? -- Neil Hobson Exchange MVP For Exchange news, links, and tips, check: http://www.msexchangeblog.com "A.dian�" <Adian@discussions.microsoft.com> wrote in message news:31CB593F-F4DD-4CAB-9F4E-C2131BF7CF95@microsoft.com... > I was migration my Exchange 2000 to 2003 I do my forest prep and domain prep > But i can't create mailboxes ??? > Why??? > some documentation...

Help ! formatting data to text
I am creating data in an Excel spreadsheet. I then want to get that data into a simple text email. I have some problems and questions... 1) how do I get the columns of data to line up evenly when I copy the data to email text ? Keep in mind I need to be in simple text format, not HTML or rich text. Every time I do this, all columns become chaos and are unreadable. 2) Is there a simple way to automate the creation of an email from an excel file ? this is less important to me. Thanks in advance WxMachine #1. I think it may have to do with what email client you use, too. I copy and ...

All tables are linked with weak entities. However, when i enter data on the form I can't get it to let me enter more than one partipicant without access generating a new invoice id. however i need one invoice to many participants. It wont work and i have no idea what to do at this point. in addition the workshop will not let me add workshop to invoice. this is a small mdb and i'd like to email it to anyone who can assist me with the relationships as I think this is the problem but I don't know what to do. please help me. INVOICE invoiceNO - autonumber invoice prices WORKSHOP wo...

Hot Dates
Hi, I have a Year-at-a-Glance worksheet into which users enter important dates and associated actions to be taken. I now want to use Conditional Formatting to highlight specific entries in the worksheet when their date matches today's date. The problem I have is that I need to convert data from three independent cells into a date to compare it with 'TODAY()'. The first cell (formatted as a number) carries the day, e.g. 2, 17, 23, etc. The second cell (formatted as General) carries the month, e.g. January, March, September, etc. The third cell (formatted as a num...

Outlook Express #60
I don't even know if this is the correct newsgroup to post, but I can't find any group under the name Outlook Express, so I'm trying my luck here. I'm due to upgrade to a new computer, and I'm wondering if I have to save my old mails into diskette or CD. I certainly don't want to lose all my old mails collected in Outlook Express. The big problem is - I'm not able to find anything in Outlook Express that looks like the data files for my old mails. So what do people do when they want to keep their old mails in the course of changing their computer? "p...

Newbe help with a lookup
Hi, I&#8217;m trying to make some modifications to a salary matrix and I&#8217;m having trouble with a lookup. In column A I have a series of numbers from 0 to 30 representing pay grade steps where 0 represents a new employee and 30 represents an employee having completed 30 years of service. In column B I have an annual salary for each of the corresponding pay grade steps. I want to take a new salary and find the closest salary in column B and return the corresponding step number. For example if the new salary is \$73,415.13 and the matrix shows step 15 is 73,205 and step 16 is 73...

HELP
We have an application that is used by over 8000 people worldwide. One of our users is just starting to have the following problem: Run-time error '-2147467259(80004005)': Method 'Add' of object 'CommandBarControls' failed I have read that this problem can be caused by trying to open the file in Internet Explorer. The user has told me that she has tried opening MS Excel and then the .xls file and she still gets the same problem when the file is trying to open. She is the only one that has had this problem. Could there be something wrong with her Excel settings or som...

Insert Static Date as part of Macro
I've built a nice macro, but I want it to insert the date it is run in an empty cell within the macro's range. When working within a spreadsheet, Ctrl +; returns the system date, but I can't figure out how to put that command into a macro. The macro recorder editor shows that the system recognizes the entry as the current date, not a function that returns the current date. The now() or today() functions are both dynamic ... they change with the system date. That's not acceptable in this situation. I need to seen when the macro was run. Thanks for any help, Ralph di...

O.T. FYI BlackBerry Enterprise Server Express for Free for SBS2008
BlackBerry Enterprise Server Express for Free http://na.blackberry.com/eng/services/business/server/express/ Connect two people via BlackBerry� Smartphone's and ideas get bigger. Progress happens faster. Answers get smarter. So imagine what happens when you give a business the freedom to connect all its employees. BlackBerry� Enterprise Server Express enables businesses of any size to quickly and easily get started with the BlackBerry solution. It provides advanced BlackBerry Smartphone features with no additional software or user license fees, and works with any Internet-...

How can I keep track of when (date and time) data is entered into.
I am trying to create a spreadsheet for a high school class. I need to be able to track when a student has entered data into specific cells of the spreadsheet. Any ideas? In the code behind the worksheet, enter (eg) Private Sub Worksheet_Change(ByVal Target As Range) Cells(1, 1).Value = Now() End Sub This will enter in Cell A1 the date and time at which any entry is made in that worksheet. If you need the location of the time-stamp to vary according to which cell is changed then you can test the value of Target and vary the destination cell accordingly. -- Return email address is n...

zz report date truncation
We run only z reports at end of day. We will be running cashier shifts soon and would like to run z and zz reports the way they were intended. Is there any way to truncate the zz report date for each register without it running since the beginning of time and using a truckload of paper? Thanks in advance! This may not be the most graceful solution, but you could simply turn off your printer before 'printing' the zz report. Then manually delete all print tasks for that printer before turning it back on. The report won't print, but RMS will think it did. "TV hardwa...

Help with keeping inventory.
Hello Everyone. I was wondering if someone might be able to help me. I'm trying t come up with a way to keep inventory of product. Basically what I need is to keep track of the current inventory of items... and what I'd like is for different users to be able to ope the worksheet and enter the NUMBER OF PRODUCT they are removing at tha time.... and for the total inventory of each item to be adjuste accordingly. The only catch is - I'd like to be able to use the SAM CELL always -- that is - I want only one cell to be the one that i used to enter the amount of inventory being o...

Help with Outlook Automation
I launch Outlook form MS Access 2003 using the code under the double line. When I send the first email it works fine. But if I send another email everything freezes up. I have to use the task manager to Kill OUTLOOK. And then it is immediatly replace by another OUTLOOK session and the email window comes up. I was wondering if my code could be improved to prevent that from happening. Any suggestions please! RBollinger ======================================================= Private Sub Command11_Click() On Error GoTo Err_Command11_Click Dim stDocName, mTO, mCC, mSu...

Historical IV Trial Balance
When running this report in Summary, I am receiving an error when trying to run with a date range. Has anyone seen this before? are you getting a duplicate error? If you are, then what you are experiencing is a bug. To fix, you will have to apply the latest service pack. Hope this helps. Rheiner "DavidInterDyn" wrote: > When running this report in Summary, I am receiving an error when trying to > run with a date range. Has anyone seen this before? I think so. I'll try that by applying SP 4 for 10.0 "Rheiner" wrote: > are you gettin...

Help on CString to char*
Being a newbie to MFC, I am having problems on copying CString to a char* Below is my attempt but I getting this error below: ===================================================== Debug Assertion Failed! Program: C:\geac\GEACstatusptt.exe File: dbgheap.c Line: 1044 Expression: _CrtIsValidHeapPointer(pUserData) Below is my code the way that I am doing now, look at switch 4 and this is where I call a DLL library "McaAddPageMember" ====================================================== char cPAGER_CODE[16]; CPsnstatuspttApp::m_LogTrace.WriteLine("CPsnstatuspttView::Call_Page_M...

Excel
Hi, I would like to know if there is a way to set up when I enter the data each cells on first row, it will default the date and time stamp on first row. 2nd row should have the different date and time stamp than 1st row. I put "=now()" but it create the same date and time for 80 rows. I don't want that. I want to enter each rows and each rows should be different by one minute apart but same date - June 22. Your help would be much appreciated. Thanks Format A1:A79 as Custom dd-mmm-yy h:mm Select A1 Hold down CTRL Key and hit semi-colon key then <space> bar. Sti...

Help replacing text with Yes or No
I have a field formated as general. The field contains either 1 or is left blank. If the field has a 1 I want to replace it with Yes and if the field is blank I want to replace it with No. any help is appreciated. -- Jerry Save your data and use a copy for this exercize........... Assuming your data in Column A, put this in B1 and copy down........ =IF(A1=1,"Yes","No") Then highlight the column and do Copy > PasteSpecial > Values to get rid of the formulas..........then delete column A if you wish....... Vaya con Dios, Chuck, CABGx3 "Jerry Arnone, ...

Date changing 2028....2029......1930???????
Hello! I have a slight problem, in my form i have a date section which is automated as 00/00/00. I use these for part of a report as a from this date to this date, if you put 010125 it will automatically change it to 01/01/2025. The thing I have found is that it is fine until you get to 010130 and then it saves it as 01/01/1930 :-/ any ideas? Thank You Jay -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200703/1 Assuming you're using XP, go to Regional Settings in the Control Panel, and click on the Customize button. Look on the...

Pub2K Help does not work
I have Pub2K. Recently I've updated my Office 2K with SP1 and, I think, SP3 (whatever was available on MS site). Today, I noticed that Help in Publisher does not work. Every time I try to see Help, I'm getting this Internet Explorer Script Error Message: <An error has occurred in the Script on this page. Line 1, Char 1, Error: Object doesn't support the property or method, Code 0, URL mk: @MSITStore:C:/Program...> What's going on? Did Office update caused this problem or something else is a culprit? How can I get Pub2K Help work again? Thanks for any suggestions. P.S. Hel...

help needed on multiple option buttons
Hi, I am trying to use option buttons in a few different locations in Excel. In one cell i want three options and three different buttons. In another locations, two options with their own two buttons. However, the 5 buttons act as 5 linked options, so i can only have one or another button selected at a time. I would like one of the first three selected and one of the next two and so on. Can anybody help me work out how to resolve this. Thanks, If you used optionbuttons from the Forms toolbar, put a nice groupbox (also from the forms toolbar) around each group. If you use optionbuttons ...