I have a table called tbl_IE which has a field named frequency.
I want to multiple all of the values in frequency where the ID is 1. I want to display this on the form as the data is inputted and also on the final report.
I've searched and searched to no avail to find the answer, hopefully you can help.
The story is:
At work, our holidays are now taken as hours off. For example...if I take a Monday off, its 8hrs and 5 min and a Monday morning would be 4hrs and 5 min...What I want to do is calculate how many hours I have taken off throughout the year.
The way I was going to do it was:
Create Table called Times,
Fields = Week, Day, Morning, Afternoon, Friday and 1hour all Data Type "Date/Time"
Similar field names Wk, Days, Morn etc. They would be Data Type "Number"
Now in my simple head, I thought I could simply record how many weeks or days off i had off. Then create a query (for example) Week*Wk to calculate the amount of hours I had off. In simple terms if I had 2 weeks and 2 days off, the query would multiply Week (37) by Wk (2) and Day (8:05) by Days (2), giving a total of 90 hrs and 10 min.
I know there is a datatype mismatch, but is there a way round this.
hey, i would like to see in the room price column, the total price payed for the room judging by the loyalty(no of nights). So basically i want the loyalty(no of nights X roomprice. At the moment, when i run the query it in the room price it shows just the one night price, but i want to X that by how many nights the person has stayed. I have tryed putting the sum function in the roomprice field and it didnt work.
Hi all, I have a table shown in a form, beside that table a textbox with a button. How can I multiply the numer entered in that textbox by the the number displayed in the table, and view the result in the same table?? Please help me as soon as possible?
Thanks in advanced and sorry for bothering you.....
For each Name, Number1 will always contain the values from 1 to 5. Number2 can vary, however.
I need constructing a query that, for each name, will look at the values in the Number2 column when Number1 is 1 or 2 and multiply them. So, the result I'm looking for is:
Name1 2 Name2 10
(Since 2 = 2 x 1 and 10 = 2 x 5)
I haven't had much look Googling (most search results involve multiplying two columns together, which isn't exactly what I'm after).
I'm trying to create a query that will return a calculated field called "PnL".The formula for "PnL" is as follows: PnL = notional*management_fee*NAV*
The "notional" field is a value derived from a table called "Deal_information" (primary key deal_id) and has an associated "management_fee" and "product" field. So obviously finding the product of the notional field and the management_fee field isn't a problem.
However "NAV" field is from another table (VL_information) that contains the historical Net Asset Value of each product. Fields are (VL_id, vl_date, product, NAV).
Therefore for each "notional" record I would like to return the historical PnL.By way of example. Lets say that the notional valuefor a particular record is $100, with a corresponding management fee of 10% (the managment fee is product dependent). Then I would like to find the evolution of PnL by multiplying this record by the evolution of the NAV. This would do so for each notional value.
I created a form for 'LabIssue' in which data will be entered. In the form I want to calculate the 'ChemicalAmount' by multiplying 'Store.Costperunit' with the 'QuantityIssued' which will be entered by the user. ChemicalAmount and QuantityIssued will be stored in 'LabIssue' table. I tried it through the expression builder but im getting #Name? error, did alot of things but couldnt figured out whats the problem.
I am attaching the initial database also for reference.
I have a query that calculates elapsed time from TimeIn and TimeOut formatted to hours and minutes. I need be able to mulitply the elapsed time by the hourly wage in order to find the hourly pay.
How do you format the time so that it is compatible to multiply with the wage?
My SQL statement is below. Thanks for your help.
SELECT tTimeCards.ValetFirstName, tTimeCards.ValetLastName, Format([TimeOut]-[TimeIn],"hh:mm") AS HoursWorked, [HoursWorked]*[tValets]![HourlyWage] AS HourlyPay FROM tValets INNER JOIN tTimeCards ON tValets.ValetID = tTimeCards.ValetID;
I was able to use the UNION ALL qry. But, when I have another file (like original2) that does NOT have all the columns listed in the UNION ALL qry, I get a Parameter value box asking for the missing columns when I run the qry.
original 2IDDateGroupChristianJohnny18/6/2013A212528/6/2013B2338/6/2013C2248/6/2013D22
The UNION ALL qry includes all the possible resources ( includes all the possible column fields Christan, Johnny, and Steve).
When I run the UNION ALL qry with the original2 file, An "Enter Parameter Value" box is displayed with the mssing column name "Steve".
Is there a way to Map the original2 table into a working table with all the columns, or use VBA code to construct the UNION ALL qry to only include the existing columns? My data has variable columns and I'm trying to avoid the parameter popups.
I have a MS ACCESS 2010 database with a data table which i am trying to create a query from. I have 6 columns of data( one with an ID Field and 5 Name Fields). Below i have made examples of how it first appears as a simple query and the second will show you what i would like it to look like.
What the simple query looks like: [URL] ...
Second what I want the query to look like: [URL] ....
Currently I'm building tables and forms. My first table (called Clients) lists the details of fictional clients. My second table is for invoices.
In my invoices table, I wish to link the column for client reference (note: stored in the Clients table) to the column that precedes it. This column will list the clients’ names and is selected from a drop down list that is linked to the Clients table.
What I want to do (if its possible) is to have the respective client ref. automatically show up in the next cell once I've selected the client to whom the invoice relates?
Am I making sense? Is that possible? If so, how do I do it?
Secondly, how do I do a sum of selected columns for my “totals” column? Basically, I want to add the figures found in several cells that precede it?
I'm affraid my confusing topic title is an indicator of how confused I am by this. I can't even understand the variables well enough to fully utilize Access Help or the Search function here...
What I have is a database hat has column headers that look something like this: Customer_Name, Order_Date, Qty_Ord, Unit_Price, Total_Price
What I'm trying to get is a query output that will have
Customer_Name, Total Orders (in Dollars) for January, Total Orders (in Dollars) for February, Total Orders (in Dollars) for March, etc.
I've been able to set it up to SUM for one month, but not multiples.
I know I'm totally lame (for proof read any of my previous posts) but you guys totally bailed me out the other time I asked a lame question.
I am hoping some one can help me out with an SQL string I am having problems during to get working.
This is my code
Private Sub SearchRoleSeeking()
Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim strSQL As String Dim strFilterSQL As String Dim txtBoxValue As String Set db = CurrentDb Set qdf = db.QueryDefs("qrySearch")
lstSearchResults = txtSearch1
If Me.txtSearch1.Value = "Temp" Then txtBoxValue = 1 End If If Me.txtSearch1.Value = "Perm" Then txtBoxValue = 2 End If If Me.txtSearch1.Value = "Temp or Perm" Then txtBoxValue = 3 End If strSQL = "SELECT tblPersonalInformation.[PersonalID],tblPersonalInformation.[Surname],tblPersonalInformation.[Forename],tblPersonalInformation.[DOB],tblPersonalInformation.[WantedRate],tblPersonalInformation.[WantedSalary],tblPersonalInformation.[Status],tblPersonalInformation.[RoleSeeking]" & _ "FROM tblPersonalInformation " & _ "WHERE tblPersonalInformation.RoleSeeking = ('txtboxvalue')"
let me try explain what I am trying to do. I have a form where personal information is entered into. It has an option group that allows 3 choices. I have made a form that I will use to search (the above code is from that.) What I am trying to do is if a person enters "Temp" into txtSearch1 then for the SQL statement to search "tblPersonalInformation.[RoleSeeking]" for the value 1. If a person enters "PERM then for the statement to use 2 as the value for txtSearch1 and so on.
Please don't criticize the naming, I've renamed to make the logic simpler to understand.
I am trying to run a query based on the value of a textbox. Right now if the text box is empty it shows all the records. This is what works: SELECT A.ID, B.Weight FROM A LEFT JOIN B ON A.ID = B.ID WHERE B.Weight Like IIf([forms]![Form]![txtBox] & ""="","*",[forms]![Form]![txtBox])
The problem is when tbl B is blank (and only when its blank), I also want to see all records where weight is null.
Some examples of what I've tried (I have tried variations of): B.Weight Like IIf([forms]![Form]![txtBox] & ""="","* Or Is Null",[forms]![Form]![txtBox]) B.Weight IIf([forms]![Form]![txtBox] & ""="","Is Null or Like *",[forms]![Form]![txtBox])
I am not worried about the False condition, the problem is that Null is not being returned from inside an IIF(). When I set the WHERE statement to: WHERE B.Weight Is Null, it works. But if I try IIf([forms]![Form]![txtBox] & ""="",Is Null,[forms]![Form]![txtBox]). It doesnt work (Whether I put it in quotes or not).
hi i was wondering if anyone can tell me a condition or a command in which a user will be able to enter only 6 digit number. like 123456. if he tries to enter 234 the database should not accept. is this possible also? any help would be great. Thanks
Please have a look at the following code (I am not good at VBA or SQL).
Me.[txtBox] = DLookup(“[SNum]”, “[Table1]”, “[RecID]) If Me.txtBox =>2 Then Condition if true Else Condition if false End If
I type a value in my [txtBox], a number. I want to evaluate if the typed value meets the condition or not. [SNum] is serially numbered and [RecID] is autonumber Primary Key. The above code is not working. How do I achieve this? Please help.
:o Please help... I am trying to get the following results. If the Qty is less than 99 bag 10 per, if the qty is between 100 and 999 bag 100 per and if the qty is greater than 999 bag 200 per.
i have a Yes/No checkbox to indicate whether a job has been done.. if it is done then i want it removed from the list.. so i think my query sql needs to be something like..
note..the bold bit is the bit i am questioning.
WHERE (((Booking_Main.Job_Date) Between Date() And 1+Date())) AND Booking_Confirm.Job_Done ="No"
i have created a search form. any word the user types it searches certain details in my enquiries. in my form i have a list box that displays the enquiries sent by my query.
i have placed a Job_Booked (Yes/No field) checkbox in my enquiry table. this is because if the job is booked then i no longer want the record to appear in the enquiry list im sending to the form. ive tried this code, but even when i tick the job booked button, the enquiry is being displayed.. why is this
SELECT zEnquiries.Enquiry_Date, zEnquiries.Job_Date, zEnquiries.Job_Day, zEnquiries.Job_Time, zEnquiries.Enq_Forname, zEnquiries.Enq_Surname, zEnquiries.Pickup_Add, zEnquiries.Pickup_Post, zEnquiries.Dest_Add, zEnquiries.Dest_Post, zEnquiries.Quote, zEnquiries.Car, zEnquiries.Passengers, zEnquiries.Luggage, zEnquiries.Notes, zEnquiries.Job_Booked, * FROM zEnquiries WHERE (((zEnquiries.Enq_Forname) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Enq_Surname) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Job_Date) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Enq_Phone) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Dest_Add) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Dest_Post) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Pickup_Add) Like '*' & Forms!Enquiry_Search!Search2 & '*')) Or (((zEnquiries.Pickup_Post) Like '*' & Forms!Enquiry_Search!Search2 & '*')) And zEnquiries.Job_Booked=False ORDER BY zEnquiries.Enquiry_Date DESC;
I can't get this expression in Query to work! Any suggestions?
Account Type: IIf([parent account name] like “*hosp*”,"Hosp",IIf([parent account name] like "*vet*”,"Vet",IIf([parent account name] like “*dds*”,"DENT”,IIf([parent account name] like "*dmd*”,"Dentist”,IIf([parent account name] like "*pharm*”,"Pharm”,0)))))
as you can see I am doing search and identify for a new field.
I get an error message "the expression you entered contains invalid syntax"
i have a form of Employee Info, where with navigation button i move to the next employee. i have put a Command button to Preview Report on Single Employee Info that i am reading currently. So i want to Filter the Report with Single Employee Name and records so im coding on click even of the command button (see below) and its giving me null report.
im using where condition to filter the report and assign to it a variable employee name from the form. Reminding that source codes of both Form and Report is the same
Hi everyone, i have a form for bookings. People book by entering (among other stuff), the date and the booking slot.
Basically, what i need to do is have it so that only certain booking slots can be chosen on differnt days... for example, the booking slot of "Eve Extension" can only be used when the date refers to a Friday or Saturday, any other days it would not be allowed.
Is there any fool proof way of doing this, keeping in mind i dont exactly know VBA at all....
What method(s) are available to detect when a user is at a new record? I really just want to change the .text property of a combo box when the user is creating a new record. If this sounds stupid, I can explain the specifics.
I got this code to run correctly, which pulls records where they are not junk(can be seen at end of where condition), the only issue is that the "AND" does not turn blue. Is this a problem?
Code: If Not IsNull(Me.txt_last_rec_id) Then 'DoCmd.SetWarnings = False SQLText = "INSERT INTO tbl_batt_id " & _ "(record_num, bat_id, manufacture, date_code, barcode, status) " & _ "SELECT " & Me.record_num & ", bat_id , manufacture, Date_Code, barcode, Status " & _ "FROM tbl_batt_id " & _ "WHERE record_num = " & Me.txt_last_rec_id & " And [Status] <> 'Junk'"
I'm trying to put in a Where Condition for an ApplyFilter action, but it only allows up to 255 characters, I need more. I have very little experience using code!I want this to be the Where Condition:
Code: [Program Name] Like "*" & [Forms]![Program List]![Text34] & "*" Or [Organization] Like "*" & [Forms]![Program List]![Text34] & "*" Or [Program Type] Like "*" & [Forms]![Program List]![Text34] & "*" Or [Main Office City] Like "*" & [Forms]![Program List]![Text34] & "*" Or [Main Office Province] Like "*" & [Forms]![Program List]![Text34] & "*"
How do I make this into the Where Condition? An full example would be nice.