Hi -
Try playing with this:
Public Function MedianF(pTable As String, pfield As String) As Single
'*******************************************
'Purpose: Return median value from a recordset
'Coded by: raskew
'Inputs: ? medianF("Orders", "Freight") <enter.
'Output: 41.36 (may vary...
Hi -
Applying formatting to a date/time returns a string, which may not be helpful if you intend to use any of the built-in date time functions. Look at this MSKB article to see how Access stores date/time
http://support.microsoft.com/kb/q130514/
Consider the TimeValue() function, e.g. from...
Hi -
Regardless of formatting, Access stores dates in a date/time field as doubles representing the number of days since 30-Dec-1899. You can test this from the debug (immediate) window:
Today is 28-Sep-2006
? cdbl(date())
38988
Attempting to store 290906 in a data/time data type field will...
And if the criteria changes you do what?? Let's go back in and rewrite the code. Splendid!
Why are you using Now() rather than Date(). Is there a time involved here. Can't find any reference to one. Lookup the Date() and Now() functions to see the differences.
Bob
Hi -
To make this dynamic so that you don't have to go in and change the coding each year, place this as the criteria for your date field:
between [enter start date] and dateadd("yyyy", 1, [enter start date]) -1
HTH - Bob
Hi -
There are many instances when a fiscal year does not start on 1 Jan. Try the following which allows the user to specify the FY start date.
Function fGetFYQtr(FYStart As Date, pDate As Date) As Integer
'To call: from debug (immediate) window
'? fGetFYQtr(#7/1/06#...
Hey rjoubert-
That's all well and good, but it does nothing if you're using A97.
If we can't come up with a universal solution, I'll lay one on you, using 'roll your own' substitutes for each of the built-in A97+ functions.
Abaldwin's solution sounds great. Just need a littlr guidance on...
It sounds wonderful. Let me show my ignorance here.
VBE6.dll exists on my system. It doesn't show up under
References. What to do to register it?
Best wishes, Bob
Hi -
Copy/paste this to the criteria cell of your date field:
Between Date() And Date()-13
The Now() function includes both date and time. Better to stick with the Date() function which provides just what it says.
HTH - Bob
Remou -
The poster's question was not about time as in date/time data type, but rather elapsed time, e.g. I worked 12 hours and 5 minutes yesterday and 10 hours and 25 minutes today for a total of 22 hours and 30 minutes.
I'm confused as to how the FAQ relates.
Bob
Hi -
Keep in mind that you're dealing with periods of elapsed time which doesn't follow the same rules as actual times in data/time data type. Give this a try:
Function ElapTimeAdd(pfirst As String, pnext As String) As String
'***********************************************
're...
It may seem that the DateDiff() function should return Age based on Date of Birth (DOB) and a user-specified date. However, there's a problem with that solution since the DateDiff("yyyy"....) merely subtracts one year from another.
To accurately return age in years,we must know whether the...
Hi-
It sounds as if this calls for a Boolean vs. text field.
The test for Graduated is either true (-1) or false (0).
There's no place for Null. Displaying a checkbox bound
to a boolean field, the value is either -1 (Checkbox
checked) or 0 (Checkbox not checked).
Consider adding a new...
Hi -
Try this in a test table. Don't try it with your working table until you're entirely satisfied with the results.
1) Create a query, pulling down all fields that may contain an undesired word, phase or character.
2) Copy/paste the following code to a new module.
3) Change the Select...
Pete-
The dateadd() function should give you what you're after.
From the debug window:
appttime = #10:30#
warntime = dateadd("n", -90, appttime)
? warntime
9:00:00 AM
HTH - Bob
V-Tools, a freeware add-in appears to --in its Deep Search mode-- go down to the level you're looking for. Tried a test
and it provided every reference to OrderID in tables, queries, reports, forms.
You can download it at http://www.skrol29.com/us/developpements.php
HTH - Bob
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.