Date Functions?

Dec 5, 2007

Hi everybody,

Hope all is well! I need to create a ad-hoc report for the rental items table . For example the table has an Expired Date. What kind of Date function I can use, so everyday, I can query out and show report for those rental that have 1 week prior to expiring date? Please help. Thanks so much!

For example : The Rental table has 3 records:
Item 1, Expired Date on 12/13/07
Item 2, Expired Date on 12/22/07
Item 3, Expired Date on 12/29/07

If I run the report on 12/06/07, then the report should show Item 1 since it is expired in 1 week.

View Replies


ADVERTISEMENT

Date Functions?

Feb 13, 2008

Hi all,

Hope all is well! I have few questions to ask:

1/ First of all, how do I view in the Forums all of my own threads that I created? (silly question! )

2/ In MS Access 2000, what Date function/calculation expression used to count number of days between 2 date EXCLUDING weekends or even EXCLUDING Friday, Saturday, and Sunday? (since the workers work from Mon-Thu weekly).
For example:

Date PO enter field: 02/01/08
Date PO sent out: 02/07/08

I would like the Number of Days will return 3 instead of 6 (since we don't count Feb 2, Feb 3, and Feb 4 since they are Friday, Saturday and Sunday)


3/ If I have a Date field called "Rental Expired Date", what is the Date function that I can use to give me the report of any given day of all the items that will be expired 2 weeks from the day I run the report? Better yet, our office use Novel Group Wise email application, is there a way to send this report directly to a particular person Inbox everyday?

Thank you for your help,

View 1 Replies View Related

Queries :: IIF Statement With Date Functions

Feb 24, 2014

My goal is if the current date = 1st - 4th of the month to return the failure_date if it is >= 1st of the prior month and <= 4th of the current month (ie, 01/01/14 - 02/04/14)

this works:
>=DateSerial(Year(Date()),Month(Date())-1,1) And <=DateSerial(Year(Date()),Month(Date()),4)

But if the current date > 5th of the month to return the failure_date if it is >= 1st of the current month and <= 4th of the next month.(ie 02/01/14 - 03/04/14)

this works
>=DateSerial(Year(Date()),Month(Date()),1) And <=DateSerial(Year(Date()),Month(Date())+1,4)

But when I put it in the iif statement if will not work:

IIf(Date()>DateSerial(Year(Date()),Month(Date()),4 ),>=DateSerial(Year(Date()),Month(Date()),1) And <=DateSerial(Year(Date()),Month(Date())+1,4),>=Dat eSerial(Year(Date()),Month(Date())-1,1) And <=DateSerial(Year(Date()),Month(Date()),4))

SQL =
SELECT table_testing_dates.Failure_Date, table_testing_dates.Failure_Date, table_testing_dates.FailureGrouping
FROM table_testing_dates
WHERE (((table_testing_dates.Failure_Date)=IIf(Date()>Da teSerial(Year(Date()),Month(Date()),4),(table_test ing_dates.Failure_Date)>=DateSerial(Year(Date()),M onth(Date()),1) And (table_testing_dates.Failure_Date)<=DateSerial(Yea r(Date()),Month(Date())+1,4),(table_testing_dates. Failure_Date)>=DateSerial(Year(Date()),Month(Date( ))-1,1) And (table_testing_dates.Failure_Date)<=DateSerial(Yea r(Date()),Month(Date()),4))));

View 2 Replies View Related

Access2000 Nested IIf() Functions In Date/time Format

Aug 8, 2005

I am working on a report in Access2000 which is getting information from several tables via a number of queries.
I am using nested IIf() functions to combine text formatted data in a calculated query field before using it in a report.

One such IIf() function is

Desc_col: IIf([HOVR - UDP].[SERVICE] Is Not Null,[DA] & " " & [SEQ] & " " & [TYPE] & [MO] & " " & [SUB] & " - " & [HOVR - UDP].[SERVICE],
IIf([MinOfCCT] Is Not Null,"I/O DIST CAB " & [UDP - JC CIRCUITS-05-F].[PWR] & " - CCTS " & [MinOfCCT] & " thru " & [MaxOfCCT],IIf([DESCRIPTIO] Is Not Null,[DESCRIPTIO],"Spare")))

When I have tried to do the same thing with date fields it does not work. The function is fine as long as it is not nested.

That is

Rev_col: IIf([Rev_HOVR] Is Not Null,[Rev_HOVR],"")

and

Rev_col: IIf([Rev_Elec_equip] Is Not Null,[Rev_Elec_equip],"")

both work.

But when I combine them into a nested function

Rev_col: IIf([Rev_HOVR] Is Not Null,[Rev_HOVR],IIf([Rev_Elec_equip] Is Not Null,[Rev_Elec_equip],""))

I get an error message "! Data type mismatch in criterial expression"

There is no data mismatch in the original tables from which the information was extracted. The dates are all in DATE/TIME and set to "General"format in the tables.

I am wondering if I will have to use Visual Basic function to combine these fields. However that poses a problem. When I've looked at this I find that runtime VB is no longer available in Access and I do not want to go out and buy it on the offchance that it will work.

Can anyone tell me if there is another solution to my problem?

View 4 Replies View Related

Modules & VBA :: Date And Time Functions Not Using Current Info

Jun 30, 2014

Encountered a situation where the Date and Time functions in VBA are not using current data? I have VBA code that uses Time to determine certain actions. A new associate took a copy of that code and started tinkering with it to complete a project I assigned. Now, his copy of the code returns old data for the Date and Time functions. It returns 5/27/2014 for Date and 7:15:42 AM for Time. The Now function works properly.

Additionally, running the Date and Time functions in queries works fine. I've compacted and repaired the Access database, I've checked the references, and I've checked to see if he assigned values to variables named Date or Time, but I don't see anything wrong. What am I missing?

View 14 Replies View Related

Functions

Jun 15, 2005

i have the following line:

Me.Text2 = Right(Me.Text0, InStr(1, Me.Text0, ".") - 1)

and i would like that if Text0 is "test.exe" i want to return "exe", however, with the above i am getting ".exe" ... can someone tell me what i am doing wrong please ?

Thanks

View 4 Replies View Related

Help With Functions

Jan 4, 2005

I currently have a text box that is calculated off of 6 other text boxes. I want the one field that is calculated to update any time I change any of the other fields. I can do this by putting the same calculation in each ones afterupdate event. Below is one section of my code for the arithmetic, and I want to perform that code many times. Can I use a function to do this, and if so some help would be nice? thanks

Private Sub HEAVY_AfterUpdate()

Total_Sheets = SECOND + HEAVY + LIGHT + SCRAP

Total_Sheets = Total_Sheets * YIELD

Total_Sheets = Total_Sheets + D_Sheets

Total_Sheets.Text = Val(Total_Sheets)



End Sub

View 2 Replies View Related

IF Functions?

Aug 18, 2004

In access, I'm trying to create a database to track material that has an expiration date of one year from the appointment letter date. I'm not sure what I need to do here. Here's what I have: I have a table that has fields for the individual (UNIT), the appointment letter date (Appointment Letter Date), and a True/False field (Out of Date) that I want to make True when the current date is greater than the (Appointment letter date + 365 days). Is this possible through Access tables and/or queries or will I have to incorporate VB? I am an extreme novice when it comes to expressions and query building in Access.

Nathan

View 6 Replies View Related

Missing Functions

Aug 17, 2005

Hi,

I have build a database which work perfectly on most computers. But one or two for the computer are error with the Left, Right and Date SQL function. Is it simplely miss for the install or it a problem with my code?

Thanks

View 2 Replies View Related

Search Functions

Jan 12, 2006

Hi everyone,

Thanks for taking the time to read this.

I will firstly give you the low down on the business that I am doing the database for. It is a Car Restoration Business, where we deal with vintage/classic/muscle cars and restore them to the former glory.

I do not know Microsoft Access very well, I have attached a file with what I think is a databae :) I could be wrong. The main function of this database is to search for suppliers for a specific car part for a specific car.

So if I want to find a doorhandle for a 1970 Ford Mustang, I need the suppliers pertaining to those criterias to come up.

How do I get this to happen?

Thankyou for your help

Jess:confused:

View 2 Replies View Related

MS Access And Functions

Nov 3, 2006

Hello,

I have developed a MS Access database which uses several functions such as DateDiff and inStr. When I use these function on my machine the database runs fines and the values are calculated.

However the database I have developed is not for my computer and when run on this one computer produce some errors (The date function is mentioned). I believe this is some sort of security issue but I cannot be sure.

Both computers run the same version of Office. Does anyone have any ideas.

View 2 Replies View Related

MS Access And Functions

Nov 3, 2006

Hello,

I have developed a MS Access database which uses several functions such as DateDiff and inStr. When I use these function on my machine the database runs fines and the values are calculated.

However the database I have developed is not for my computer and when run on this one computer produce some errors (The date function is mentioned). I believe this is some sort of security issue stopping her running the functions.

Both computers run the same version of Access. Does anyone have any ideas.

View 3 Replies View Related

Built In Functions?

Aug 8, 2007

Does anyone know of a good resource to mull through all of the built in functions and learn their syntax, uses, etc?

Thanks

bluke

View 2 Replies View Related

Functions List

Dec 7, 2007

Is there a list anywhere that tells what all the functions do in access?
I mean functions such as:

RTrim
RTrim$
SaveSetting
Seek

There is a big long list, and some of them.. I have no idea what they do.

View 7 Replies View Related

Multiple Functions

Oct 12, 2005

I have a query that contains a field with 4 codes that I need to replace with values.

Example:
Replace([CE020]![LNCH_FLG],"0","None") Replace([CE020]![LNCH_FLG],"1","Free") Replace([CE020]![LNCH_FLG],"2","Reduced")
Replace([CE020]![LNCH_FLG],"3","State Free")
Replace([CE020]![LNCH_FLG],"4"," Paid")


I get an invalid syntax error, I know if I was to have one Replace function it will works fine, but I’ll still have 3 code to convert.

Any Ideas?

Thanks
--pete

View 7 Replies View Related

Queries And Functions

Mar 20, 2007

Hi,

I need some help with a function inserted into a query.

I created a function to convert numbers into text. I then created a query to pull some fields from a table. the last field of the query, I inserted the function using the build feature. I was able to see the function in the list of custom functions for the query.

However, when I run the query I get an error message of undefined function - name-. Can I use my function there? or is there some other way to do so.

thanks for any help received.

Regards,

CathyM

View 2 Replies View Related

Two Count Functions

Feb 6, 2008

Hi
Im trying to run two count functions on one column in sql (access 2003). I need to return two new column, pass and fail. something like this; select count(grade) as pass, where grade>=40 and select count (grade) as fail, where grade<= 39.

my table is student_ID, module and grade:

student_ID Module Grade
0012 history 59
0034 history 34
0045 maths 78
0031 maths 45
0046 spanish 66

what i need is:

Module Pass Fail
History 1 1
Maths 2 0
Spanish 1 0

I have achieved it by running two seperate querys, one for pass and one for fail and then merging them with another query but is there any other way?

View 1 Replies View Related

Functions Error

Mar 31, 2008

I have looked and looked at this expression line and cannot find what is wrong.

Repaired: Sum(IIf(work!status=4 And work!code=11 And work![tin date] Between DateSerial(Year(date(forms![enterprise report card].[combo31])),Month(date(forms![enterprise report card].[combo31])),1) And DateSerial(Year(date(forms![enterprise report card].[combo31])),Month(date(forms![enterprise report card].[combo31]))+1,0),1,0))

This gives me an error "Expression entered has a function containing the wrong number of arguements"

However this one:
Repaired: Sum(IIf(work!status=4 And work!code=11 And work![tin date] Between DateSerial(Year(Date()),Month(Date()),1) And DateSerial(Year(Date()),Month(Date())+1,0),1,0))
works fine... The only difference is I inserted forms![enterprise report card].[combo31] inside of the Date() function.

Can anyone see what I might be missing??

View 4 Replies View Related

Financial Functions

Sep 23, 2005

I am doing some work on a loan calculator which I have done successfully in Excel. I now wish to do this with an Access form (A2K). Can anyone please confirm that the Financial Functions (ie CUMPRINC etc) that are available in Excel can be used in Access. The Access help menu calls them Worksheet Functions and I can't see any reference to the above function in this forum. I have entered it in a control and get a #name? error. I dont know if I have made a syntax error or that Access doesn't recognise it.The following is the formula I have used =CUMPrinc([rate]/[freq],[nper],[amount],1,[nper],0).

I have not had the same problems with the following formula =PPmt([rate]/[freq],1,[nper],[amount],0)

Cheers

View 2 Replies View Related

How To Use Min And Max Functions In Rows?

Sep 24, 2004

Hi there,

I`ve got a problem with access. I Have data in several columns like:

Date Value 1 Value 2 Value 3 Value 4
1-1-01 12 10 11 9
2-1.01 14 7 16 11
etc.
Now I would like to add two columns that determine the min and max value of a row. Like below:

Date Value 1 Value 2 Value 3 Value 4 Min_value Max_value
1-1-01 12 10 11 9 9 12
2-1.01 14 7 16 11 7 16

Is this possible with the standaard min function? or how else do i do this?

View 12 Replies View Related

DateAdd Functions

Mar 10, 2005

I enter this statement on my control source in a text box
of a report for a date field.

=DateAdd("d",1,[startdate]

I get error when I preview the report. I trying to add 1 day
to the date.

Thanks in Advance

View 2 Replies View Related

Worksheet Functions

May 23, 2006

I need to find the latest of several date fields in a SINGLE record of a query. The Max function seems only to work for a single field across several records in a query. However the worksheet function Max suggests I can use it for in-record fields but it does not work in queries. It is called a Worksheet Function but what is an Access worksheet? I know what it is in Excel but not Access. Neither Help nor two thick reference books even mention worksheets.

View 7 Replies View Related

Queries And Functions Help

Aug 25, 2006

hi,
what im trying to do is use the code below, coupled with a append query, to
make the value of the 'lag' variable go into the feild in 'tblplayer' 'Lowes
t_age_group"

can anyone see what im doing wrong?

thanks
any help would be much apreciated

Nick


Public Function fnlag()


Dim cutof As Date
Dim age As String
Dim Birthdate As Date
Dim age1 As String
Dim lag As String

cutof = DLookup("[cutoff]", "[tblseason]", "[tblseason].[is_current] = -1")
Birthdate = DLookup("[Birthdate]", "[tblplayer]")
lag = 1
lag = DLookup("[Lowest_age_group]", "[tblplayer]")

age = DateDiff("yyyy", Birthdate, cutof, vbMonday, vbFirstJan1)
'MsgBox (age)
lag = age + 1

End Function

View 1 Replies View Related

How To Use F Functions In POS Systems

Aug 23, 2012

how to use f functions in POS systems?

Eg F7 edits records in a form,F8 opens a customer account,...

View 1 Replies View Related

Functions No Longer Working

Sep 29, 2005

Not exactly sure if we has anything to do with sql server so sorry if it isnt strictly relevant.
I have a database on sql server and am using an access data project as the front end. Have finsihed this and is working fine till I try and use it on another computer on the network. It still connects to the database fine (well on most machines on the network not sure why not on the others) but the problem is access functions in my reports and forms seem to have stopped working and show up as ?#name
Examples of the kind of functions I am talking about are

=Format$([DateFrom],"Long Date")

=[SumOfMinutes]60 & Format([SumOfMinutes] Mod 60,":00")

any suggestions?

View 1 Replies View Related

Using Switch Functions In Expressions.

Oct 10, 2005

i'm trying to use a switch function in a query but i'm unfamiliar with the format a bit. here is what i'm trying to do...

switch([Radios]![Warranty] and [Radios]![HousingWarranty]=true,[Radios]![Change front housing]*(25/60*28), [[Radios]![Warranty] And [Radios]![PortableHousingWarranty]=true], [Radios]![MaterialsUsedPrice1])

basically first statement is condition second is execution. I need to add more but i'm getting an error from this much...if I was doing this in vb.net I would just do if, ifelse, ifelse, ifelse...but...

Thanks,

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved