i have a crosstab query that contains employees and their sassocaited assignements he/she is working on. each assisgnment is associated with a start and end date. there are monthly columns that forecast until 2007.
i need to create a headcount report that provided a count "1" for each employee in a monthly column.
currently i there is a Vaule Field that Counts the number of Employee......yeilding the desired "1" BUT i want it to only populate a "1" if the Montly Column is Between the Start and End Date for the assocaited assignment.
is it possible to add a If Statement in the Employee Column to only Count if the Month from the column is between the assignments start and end?
In this table it has a bookingID, CustomerID and some other none relevant details.
The CustomerID comes from table tblCustomer. i.e a customerID must exist in the customer table to be allowed in the bookings table tblBookings
A customer can exist in tblCustomer without existing in the booking table.
I am trying to write a query that will list each and every customer ID in the tblCustomer and count the number of bookings that that customer has (even if it is zero).
I have a query that will count the bookings if they exist in the booking table and display the number of times that a customer appears in the bookings table.
SELECT tblBookings.CustomerID, Count(tblBookings.CustomerID) AS NoOfBookings FROM tblBookings GROUP BY tblBookings.CustomerID;
How do I create a query that will do this but list all customers even if they don't exist in the bookings table (but obviously occur in the customers table)
I am trying to create a similar query where all bookings per hotel are listed even if no bookings are made for that hotel. I am guessing the answer is the same as above.
The Ritz. Bookings 0 The Hilton. Bookings 3 The Carlton. Bookings 0 The Lowry. Bookings 2
I'm trying to calculate a value for a field based on the value of another field, [Field1] has a value list of 28 choices I want [Field3] to take that value and multiply it by the value of [Field2]. I'm using an Iif statement and it sort of works. I looks like this:
IIf([Field1]=1 Or 2 Or 3 Or 4 Or 11 Or 12 Or 13 Or 21 Or 22 Or 28,[Field2]*0.06,IIf([Field1]=5 Or 6 Or 14 Or 15 Or 23 Or 24 Or 29,[Field2]*1.1,[Field2]*2.1))
I receive nor errors but it will only return the value of [Field2]*.06 no matter what is selected in [Field1].
I'm sure I'm missing something and there is probably an easier syntax to use, but I'm at a loss at the moment.
I am trying to write a statement and it returns: #Type!. I know what this means but it should not give this error.I have button that copies a certain number of fields to the clipboard. The one below is one of them. Here is the coding I am using that works:
Code: =Trim(IIf([CallingContactRel] Is Not Null,[CallingContactRel] & ": " & [CallingContact],[CallingContact]))
I would like to add the following condition to this code. I have a yes/no field called BookingNoteContactExcl. If this is ticked, it should exclude [CallingContact] from being copied, in other words, return "" in the code above.
I'd really appreciate some help for what I fear is actually a very amature question...any assitance would be greatly appreciated!
I have the following table:
SubCount---------HomeDetailsID------FoodDetailsIDFK--PrimaryName Ruteete--------------199------------------54-----------Amatehe Ruteete--------------218------------------54-----------Amatehe Ruteete--------------199------------------54-----------Amatehe Ruteete--------------198------------------90------------Amoozi Ruteete--------------204------------------90-------------Amoozi Ruteete--------------192------------------20----------Banana Juice
By Subcounty, it shows what homes in the subcounty are consuming a particular food item. What I would like to do is count the number of times that food item is being consumed in each subcounty and generate a new table to compile this data.
And I am trying to use the count function to return the frequency of each Food being consumed. However, the count function counts all the records and returns a value of 6. What I would like is it to count the frequency of each food and ultimately build the following table:
I was thinking that this may involve using a loop to get a count on each specific food but the logistics of doing this are beyond me at the moment. Does anyone have any suggestions?
I have a table called myTable and it contains two fields Year and Month. Both are type of integer.
Now in my select statement, I like to combine these two fields in to one and name it as period and it will have the format, for example 200501, 200502, ..., 200512. How can I do that in Access query statement?
I know how to do this in SQL Server 2000. That is:
Select Convert(varchar(4), [Year]) + right('00' + cast([Month] as varchar(2)), 2) as Period from myTable
I am working on a hired plant database and want to limit the combo box on the hired form to only list items not on hire.I thought I could do this using the IssueDate and ReturnDate fields within a query with an IIf statement forcing the Yes/No field to choose Yes when there is a date in the IssueDate field and No when the ReturnDate field has a date entered.
I am having some trouble with an iif statement as selecting the field..I have two columns, one called [sdCounterpartyprice] and one called [bid]I want to select the [bid] if it's not equal to Null or 0, if it is equal to that then pick [sdCounterpartyprice]this doesn't work
Code: CptyPrice: IIf ([bid] is null or = 0; [sdCounterpartyprice]; [bid])
How can I add a field that just populates "1" for each record so I can do a count. I know I can count based on a specific field but my boss wants to see a field that just shows "1" so I can SUM it up in another query.
I have a dataset with "Date", "Product ID", and "Revenue" fields. I'd like to create a query that rolls the data up at the daily level and reports "Count of Product ID" (unique product IDs) and "Sum of Revenue". I'm having trouble figuring out the logic.
I have a 3rd party database where I have no control over how the data is entered. I've been given the task of creating a Crystal report that would need to gather data from two databases. The link between the two databases in my report would be on a quote number. In one database, the quote number is in it's own field. In the 3rd party database, the quote number is stored in a memo field along with other data. Here's an example:
The data I'm after is C7875 T7761 T6895 T7152A *No data from the 5th row since the data after the "T" isn't numerical
So far I'm thinking of using an IIF statement to check for the existance of a C or T, then if true, use a nested IIF statement within the first to check for numeric, if true, use the Mid function to pull out the quote number.
My first concern is this could become a complicated IIF statement and was wondering if there was another direction I should be looking in acheiving this.
My second concern is if I go with this method, some of the quote numbers have a space after them, some of them have no space after them, some may even have a "/" after them. How would I go about accomplishing this?
In my statment below the ID is an autonumber. I placed it in the first part ofthe SQL string..but not where I have to variables referenced...
I have to add it to the SQL statement...Its not a varible although I can make it one by getting the largest number nad adding one... Do I have to make it a non-autonumber and do it like I said above
Or is there another way to treat the autonumber (ID) in the SQL INSERT INTO statement...
I have a schedule table which contains a field for the start date of the schedule and another field that contains the start time of the schedule. I want to combind these two fields in a sql statement so that I can query for a range of schedules based on the date and time. The below sql statement works fine in a query, however, when I tried to use it in a opening statement in ADODB, it does not work. ADODB somehow does not like the combinding of the date and time fields. Can someone point me to the right direction in achieving the same result.
mysql = "SELECT tbl_Customer_Site_Schedule.*, CDate([startdate_sch] & " " & [starttime_sch]) AS StartShift FROM tbl_Customer_Site_Schedule WHERE (((CDate([startdate_sch] & " " & [starttime_sch]))>=#11/5/2007 20:0:0# And (CDate([startdate_sch] & " " & [starttime_sch]))<=#11/7/2007 20:0:0#)) ORDER BY CDate([startdate_sch] & " " & [starttime_sch]);"
My update statement is shown below. What this is to do is change the PGTIN record in PP TBL to the GTIN that is in the UPC TBL where the UPC Code on the form is the same as the UPC Code in the UPC TBL. I am getting the error message "can't find field..." I have double and triple checked the field names but cannot find my error. Both PGTIN and UPC Code are text fields.
The Timestamp Field I have is formatted like this: 11/4/2014 5:56:46 AM. The field name is [Timestamp] it is in a table named INPUT_RedSheets_Plates. I have a query right now that pulls in certain fields from this table based on criteria of the [Type] field Like This:
I have attempted to create a chart in Access and it does work to a degree, but I get the strange sample chart in design view and can see charting the data in my database to be troublesome.
I've had a "brainwave".
I'd like the user to have a command button to bring up a form screen or a report screen and for it to have some data in it.
I have a field 'Reason' and it's text box is actually a combo box containing around 9 different values.
I'd like my form/report to list these values then next to it tells the user how many are displayed.
Below is just three things that is in the 'Reason' combo box. I have around 9 different ones in total.Notice on the right I have example numbers. Is there a way to do calculate this?
I have a list of clients in a query field and I want get a count of the number of unique clients. Some records have duplicate clients. Lets say there are a hundred records but only 50 unique clients. When I apply "unique values" in the query's properties, and then enter "Count" in the Sum field, it gives me a count of 100 not 50. When I remove the Sum field, it lists the unique values correctly (50). Thanks.
I have a report with a field that returns data according to a date that the user enters when he opens the report for viewing (this is based on a parameter query). So for date 1 you have let's say 10 names and for date 2 you have 5 names. Now here is my question:
How do I create a box on the report wich returns a count of the names field? So for date 1 it should return the number 10 and for date 2 return 5. I don't particularly want to have this in the query but would prefer to have this just on the report...
I need to count a yes/no field. If the check box is checked I need it to count the checkmark. If it is blank I don't want it counted. I am trying to put a calc in the Group Footer because I want it based on the group of checks for a certian person. I know there has to be a way to do this and I am just not figuring it out. Can someone lend me a hand is getting this going.
I working on simple MS Access program which have 2 tables. As you can see in snap shot. What I am trying to achieve is. I would like to run a query which shows data between certain dates(It is done) and also to show me which Technician has done how many jobs(i have 5 technicians) and how much money a technician received by a payment method like Technician ID 1 did Cash Transactions 4 worth $300 similarly Credit Card transactions 2 worth 120$ and so on for other technicians.
The main theme is to get weekly summary report of technicians how many jobs they done and how many transactions each technician made by cash, by credit card along with their amount.