Queries :: Formula To Capture Filename In Query?
Jan 25, 2014Need a formula which can capture filename for me. For example, I have a db saved at "C:DlocationofficeChina.accdb". Is there a way to capture "China" in a query?
View RepliesNeed a formula which can capture filename for me. For example, I have a db saved at "C:DlocationofficeChina.accdb". Is there a way to capture "China" in a query?
View RepliesI have a query which exports to a excel file afterwards, however, it's not capturing all the data I need.My query is at the bottom, and I think the problem is the "(([tbl Master].ID)=[tblRequest].[Cost Centre]))" statement, as this means that it'll never pick up a Cost Centre starting with "Z", as they don't exist in [tbl Master] (they're exceptions to the rule basically).
What I need to do is only parse the statement "(([tbl Master].ID)=[tblRequest].[Cost Centre]))" if the Cost Centre doesn't start with "Z", if it does, then it'll find it in the table, as there's validation on the point of entry that don't start with it.
Code:
SELECT tblRequest.RequestID, 'N/A' AS [Week No], tblRequest.[Refund Date] AS [Date],
tblRequest.Requester, tblRequest.Authoriser, tblRequest.Refunder AS Processor,
tblRequest.[CRIS Reference] AS [CRIS Ref No], tblRequest.[Customer Title] & ' ' & [Customer Name] AS [Customer's Name],
[code]....
How do I capture data in a field (one record) to be used in a query.I have a query with [Unit] as a criteria. I want to capture the unit info in a field then have it used in the query.
View 5 Replies View RelatedHow to apply the formula, IF (COUNTIF (O:O;O3)> 1; K3/SUMIF (O: O;O3; K: K), 1)from an Excel spreadsheet into an Access query.
View 2 Replies View RelatedI have a query that calculates input information into a value that then needs to be compared to another query values and will be used to output a % change in a third query. Is there any way to make this happen? Thank you in advance!
View 2 Replies View RelatedAccess 2003
Excel 2003
I have a routine that exports the results of a query to an Excel file. Is it possible to input the formula into the query so that the Excel values calculate?
This is the formula I am trying to pass to the "AZ" column of the Data tab
Code:
MyCalc::"IF(T2="","0",TODAY()-T2)"
=TEXT(TRIM(MID($A2,5,2) &" "&LEFT($A2,3)&" "&MID($A2,8,10)&" "&RIGHT($A2,2))+0,"dd/mm/yyyy hh:mm:ss ")
Is it possible to replicate the above formula from Excel into criteria in an Access Query.
Assume the cell reference $A2 is a text field which has customized date info in it but is not a recognized date format.
I got a table salaries master I want to extract some info out of and calculate some values. The formula below doesn't work, I'm pretty sure it has to do with [pay period] being a text field. Is there no way to make it work?
'Gross monthly Salary: IIf([Salaries Master]![Pay Period] = "weekly";[Salaries Master]![Daily Wage]*5*52/12,IIf([Salaries Master]![Pay Period] = "monthly";[Salaries Master]![Daily Wage]*20))'
I have a table linked to SQL Server 2014. As SQL Server 2014 does not support calculated fields I created a query to use formulas. Now I want to write formulas on the existing fields ( TotalMarks ) of table Not to create new fields.
View 1 Replies View RelatedMy access is 2013.
Suppose there's a simple query which has two fields, "year" and "graduates", where "year" can be grouped by "2012", "2013", etc and "graduates" are individual names.
How can I export the list of graduates to multiple excel files, with the filename based on "year"?
I have tried to set the output file in macro as "c:desktop" & query.year & ".xls"
But it's not working and the output filename is exactly "&query.year&.xls "and the file contains all year and all names.
I have a stored query in my db. The query gets the recordcount of all the items in a table.
In my VBA, rather than code a new db conection, set a recordset etc, I want to execute the query using DoCmd
=======
DoCmd.OpenQuery stDocName, acNormal, acEdit
=======
The above line displays the results of the query.
What I really want is to run the query and store the recordCount in a variable - without displaying the results.
Can this be done?
Thanks all
Hello everyone,
Simply put, I want to create a form to which I can enter a raw SQL statement (such as: SELECT * FROM contacts without having to create a new Access query.
The way i have tried to do this is by creating a form which uses an onclick function to pass the string variable (the query statement) to a sencond form and have the second form run the statement. I can pass the variable ok but I cant figure out how to the use the variable string in the second form to execute as the "Record Source" of the form.
Any ideas?
Thanks,
Curveo
apply my situation / formula to others who had similar questions, but I get the #error output with no messages from access telling me what I did to cause this.
What I'm trying to do is create a formula that checks if two conditions are met, then applies an output. So I have a starting location [StartLocation] and [Stop2]...Both can be a small variety of locations.
Currently I have as follows:
Leg1: iif([StartLocation]="Location A" AND [Stop2]="Location B",500,0)
The formula would run longer in the end, going up to 10 stops, nesting the ifs and checking multiple locations for each stop.
Both my conditions are Text, and I want a number output depending on the location. Is it a simple error I'm looking past and missing? Or is what I'm trying not possible, I feel like it should be relatively easy. Access give me no trouble for save and running, but it outputs #error.
My Dataset:
ColunmA ColunmB Value
a b 1
b d 2
a q 3
c a 5
b e 2
d e 10
f q 1
q m 8
. . .
. . .
. . .
In Excel, I would do sumif( ColunmB,a2,Value), which gives me a result:
ColunmA ColunmB Value Result
a b 1 15
b d 2 2
a q 3 15
c a 5 8
b e 2 2
d a 10 2
f b 1 0
q c 8 0
. . . .
. . . .
. . . .
So based on each string in ColunmA, it would search all ColunmB and return an aggregated value.How can i get the same result by Access/SQL query?
Basically I would like to populate column three "OUTCOME" according to the following logic:
if train A10 has multiple destinations (we see this in the second column) then in outcome I woudl like to have "multiple destinations" if the destination is only one (in case of trains A15 and A16) , then I would like to have that city in column 3 "OUTCOME".
I am trying to paste this formula into one of my queries, but I get the "the text is too long to be edited" when I paste the formula into the designated field. Is there anyway to get this paste without getting the error?
Access experience level = medium.
CurrentPhaseMetrics: IIf([CurrentPhase]="Phase 1",IIf([NumDaysInPhase]>5,"RED",IIf([NumDaysInPhase]>3,"YELLOW","GREEN")),(IIf([CurrentPhase]="Phase 2",IIf([NumDaysInPhase]>35,"RED",IIf([NumDaysInPhase]>25,"YELLOW","GREEN")),(IIf([CurrentPhase]="Phase 3",IIf([NumDaysInPhase]>25,"RED",IIf([NumDaysInPhase]>20,"YELLOW","GREEN")),(IIf([CurrentPhase]="Phase 3a",IIf([NumDaysInPhase]>5,"RED",IIf([NumDaysInPhase]>3,"YELLOW","GREEN")),(IIf([CurrentPhase]="Phase 5",IIf([NumDaysInPhase]>5,"RED",IIf([NumDaysInPhase]>3,"YELLOW","GREEN")),(IIf([CurrentPhase]="Phase
[code]....
I need a formula to calculate date cycles.
Each person have an employment date on which a 3 year cycle is based.
So at the end of their 3 years the cycle needs to update to the next 3 year cycle.
For example
Person Employment date Cycle Start
1 01 Jan 2015 01 Jan 2015
2 01 Jan 2006 01 Jan 2012
In the case of Person 2 above the cycle would have started at 2006 - 2009 and then moved to 2009 - 2012 and then 2012 - 2015 and now 2015 - 2018
I have the following formula at the moment but need to make 100% I'm not missing something.
Also - would it be fine to run the update query each time for all persons or must it be only for the ones where the current date does not fall within the current 3 year cycle?
CycleStart = DateAdd("yyyy",Int(DateDiff("d",[EmpDate],Date())/365/3)*3,[EmpDate])
Would value your input on another way to do this as well.
I have a field in my query which returns results based on a formula that is a function of other fields. The results are: Pass and Fail. I want to make a query that returns only Fail rows. When I enter Fail as the criteria, a parameter box pops up requesting information be entered before continuing.
View 1 Replies View Relateddate formula that I was using in access 2007 doesn't seem to be working in 2010.
The formula that I had was
Between DateSerial(Year(Date())-IIf(Month(Date())<4,1,0),4,1)
And DateSerial(Year(Date())+IIf(Month(Date())>3,1,0),3 ,31).
The calculation allowed me to count holiday hours taken between 1st April and 31st March. The problem is that it was working up till 31st march but is not now showing holidays taken since 1st April.
Hi All:running Access 2000.I have a qry with a formula field that performs some calculation (Extension: CCur(([OnHand]*[Price])/[UnitsPer]))and it works fine. How can I update the actual table with the result of the calculation for every record? The problem I have is that there's some null values in the results therefore when I try to get totals on that field, it errors out saying "invalid null use"thanks
View 7 Replies View RelatedI am new to the access database world- I have a database in which I have projects that each have a priority- to get the priority # there are about 10 categories that need to total up to give me that priority #
Every formula I have tried, has given me an error message of some sort! PLEASE HELP, and please let me know if I am not explaining this enough!:confused:
Hello,
Im hoping someone can help me. Im not sure if its possible to do what I want...
I have a query with a column Ive created called Indicator. This field looks up the values of 2 other columns and returns a result based on whether they match or not. The formula is:
Indicator: +IIf(Table!EST=Table!ACT,"Match","No Match")
I need to tweek this formula so that it takes into account a variable. For example, if Est is 5 and ACT is 5.001, I want it to be a match.
Any help is much appreciated.
Thanks
First off can someone link me to a helpful page if there is one so that i can learn all these formulas, i know excel v.well but not access..
My query is:
i have the fields:
Product Quantity Unit Price Discount Discount Total Price
prod1 2 222.50 10.0% 44.50 400.50
now i have a whole number of products being listed, and 1 price for each row.. then below at the bottom of the page i have a Sub-Total / Shipping Charge / Total + VAT.
What is the formula i must use to calculate all the cells listed in the Price column (so i can work out the sub-total automatically)?
See Attached image.
Hello,
I'm quite new at this and would appreciate some advice. I have a table of football stats I am keeping. Here's what I am trying to accomplish with three columns (points_for, points_against and wins):
if points_for > points_against then 1 otherwise 0. I can do this in Excel but I'm not familiar with Access.
Thanks!
i am using a query view in an access project, using the following sql
SELECT comturbineLifeID, cycles_used, cycle_limit, cycles_used / cycle_limit AS rata
FROM dbo.tblcomturbineRata
the fields cycles_used and cycle_limit can be a null value
where cycles_used and cycle_limit are positive values, the formula cycles_used / cycle_limit just returns 0
can anybody explain what i am doing wrong, please
how do i write if null then equal to 0, the query does not accept the nz function
Hi guys,
Please would some be able to help me?
I have created a query (its a holiday chart). The table the query is created from shows dates taken in each of the 12 months under the 'month name' column and then in the next column it has the total for each of the individual month.
For example,
Field 1 (Jan)
Field 2 (total Jan)
Field 3 (Feb)
Field 4 (Total Feb)
Field 5 (March)
Field 6 (Total March)
and so on.
Then at the end I have a field for amount left. So what I need the query to do is add all the numbers in each individuals record in all the 'total month' column and then show this in another column which is my 'amount taken' column.
Thank you in advance for your help.