Queries :: How To Create A New Field Containing Only Names Of The Wards

Apr 17, 2013

I have two fields.

Field 1 contains the names of local authorities

Field 2 contains the names of electoral wards - preceded by the names of the local authority area and " - "

I want to create a new field containing only the names of the wards.

How can I get Access to read the LA names from Field 1 and strip them and " - " from Field 2 and post the resulting text in a new field?

As LA names all vary in length simply stripping out first ?? characters or words doesn't work.

View Replies


ADVERTISEMENT

Queries :: Using Field List Combo Box To Set Field Names In Query

Apr 24, 2013

I’m developing a claim tracking database that tracks dates of events that occur in the course of processing a claim; such as, Loss Date, Report Date, Estimate Date, Payment Date, etc. There are 16 different “Events” in all.I currently have the following tables set up:

tblClaim
ClaimID
ClaimNumber
fkEmpID

tblEmployee
EmpID
EmpName

[code]....

What I need to do is create a form where management can choose two or more events, and calculate the average number of days between two of any of the events, for an employee, or all employees.I have created a crosstab query to change the values in the EventName field in tblEvents to field names, and the EventDate as values for the related EventNames. I created another query based on this query to do the DateDiff.

I created combo boxes on my form with the Row Source Type set to Field List, for a list of fields in my crosstab query. I’ve tried to use the following DateDiff function to get the days between the two fields selected in my combo boxes:

Code:
DateDiff("d",[Forms]![frmReportBuilder]![cboEvent1],[Forms]![frmReportBuilder]![cboEvent2])

But I get an error about unrecognized field name or expression for my combo boxes. So I added my combo boxes in the query parameter window, with a data type as both text and value, but with both I get an error “This expression is typed incorrectly or is too complex to be evaluated.” I also specified the column headings in the crosstab but I still am getting the “too complex” error.I’m pretty sure it’s trying to do a Datediff on the literal values in the comboboxes and not recognizing that I’m trying to specify field names.Is it possible to assign field names in DateDiff this way?

View 1 Replies View Related

Queries :: Use Date Dependent Field Names?

Mar 4, 2014

Is it possible to use date dependent field names in a query?

I have this table and there are columns based on year and month (formate of names is: 2014,01) I need to select the columns of last month and then 4 months further down in history.

Is there a way to do that as the information in those columns I need to make calculations and graphs with.

View 14 Replies View Related

Queries :: Find All Field Header Names Containing String

Mar 21, 2013

I need a query to find all the field header names that contain string "PL-" and along with records contain a value with the field name containing "PL-" within a Access DB table.

View 3 Replies View Related

Queries :: Turning Column Names Into Field Values?

May 7, 2014

I have a spreadsheet which contains data exported from another system (which I have no control over). I'm using this spreadsheet as a linked table in my database.

The problem I am having is that I can't guarantee that when the spreadsheet is updated, it will contain the same column headings as it did the last time...

The spreadsheet contains a list of temps, with a summary of info off their submitted timesheets. So the column headings (as well as WorkerName, TimesheetDate, etc) may be "Standard Hour", "Overtime Hour", "Over 12 hrs Hour", "Standard Day", "Overtime Day", etc - for each type there will be a Pay Rate and a number of units (hours or days) claimed. The columns only appear if 'someone' in the spreadsheet has claimed something under that heading this week.

What I need to do is to produce a report which gives a summary by person and week of the number of hours claimed and the total charge. I've done that - that part was easy The part I'm struggling with, is how to take the column headings and turn those into descriptors for each charge type... in otherwords, to go from the sample 'timesheet' below to the sample 'ByType' ?

... when I don't know which columns will be present each week?

At the moment I'm using a union query to pull out the info I need, but if the column headings change then I know it will stop working...

sample of my union query... I currently have 8 different sets of bill rate and charge rate, this just does the first couple...

Code:
SELECT qryTimesheetBaseData.[Time Sheet Start Date], qryTimesheetBaseData.[Time Sheet End Date], qryTimesheetBaseData.[Cost Centre], qryTimesheetBaseData.Worker, "Standard" AS RateType, "Hourly" AS RateCategory, qryTimesheetBaseData.[Bill Rate (ST/Hr)] AS Rate, qryTimesheetBaseData.[Time Sheet Billable Hours (ST/Hr)] AS Billable, qryTimesheetBaseData.[Time sheet Status] AS Status

[Code] ....

View 3 Replies View Related

Queries :: Query Based On A Form Which Had Field Names And Some Values

Feb 26, 2014

I have a table listing about 20 elements as field names eg FE, CR, NI, TI and so on.

I have built a form which has a combo box listing these elements by selecting "fields" in the property settings of the combo box & next to this combo box i have 2 text box's where the user can input Min & Max values to pass on to the query.

E.g., FE (chosen from the combo box) value between (Text box1) and Text box 2.

I can run the query to give me values between the 2 text box's by using the following formula in the criteria (Between textbox1 and textbox 2).

The issue i have is to be able to select the element from the listbox, input the min & max values identified and be able to pass this to a query so the query can filter based on the field and values passed?

View 3 Replies View Related

Queries :: Yes / No Field As Bookmark In Table With Names - Open To Last Or First Check

May 21, 2013

I have a yes/no field as a book mark in a table with names. How can I query it to open to the last or the first check?

View 13 Replies View Related

Queries :: Automated System - Appending New Contacts To Data / Different Field Names

Jan 30, 2015

I'm creating an automated system on access, basically it uploads client's files and analyses their data. The files will always be different, with the amount of fields changing and with different field names each time

One part of it, is appending new contacts to their data. This means records which we can add new contacts to, needs to be duplicated with the new contact placed at the end. So it needs to be like

Company Name New Contact Name
A
B
B Tom
B Harry

Because it's automated with different field names each time, the duplicating part is an issue. I can use the * rule which appends all fields, however this will not work in this case, if we are adding more than 1 new contact, the new contact will be duplicated rather than having 2 new different contacts.

Ideally I want rule saying, append all fields EXCEPT the fields where the new contacts are placed, but I don't think this is possible

I'm using Access 07 for this. Using a mix of VBA and SQL in the modules

View 2 Replies View Related

Queries :: Keyword Search - Find Field Names Of True Checkboxes

Jul 10, 2013

I've recently finished constructing a database that uses forms with checkboxes i.e. when a user opens a form there are several checkboxes associated with labels, but the table only stores the check-boxes and the form labels are the field (column) names on the table.

Now, what I'm trying to do is create a search feature whereby if a keyword search is conducted, a search through the column names from the table with checkboxes takes place and only lines (rows) with true (checked) checkboxes are returned.

View 12 Replies View Related

Queries :: Creating Field Names In A Query That Will Automatically Update Each Month

May 10, 2013

I am hoping to create a field name in a query that will change every month. Right now the filed name is qryTechQuintileMonth-7.am_quintile. this designates that the data is for October 2012. There are 6 other fields named similarly for Nov 2012 through April 2013.

Is there a way to name these fields with the proper month-year (mmm-yy) so they automatically update each month?

View 4 Replies View Related

Field Names Don't Match Names On Form

Nov 7, 2006

I have a form with several data fields on it. I also have a button on the form that allows the user to duplicate a record . The reason for this duplication is so that if there will be an additional client record for the same customer, but only one piece of data will need to be changed, it's easier to copy the record and then change the one field.

However, I am getting the following message:

"some of the field names you tried to paste don't match fieldnames on the form"

and then not all data in all fields gets duplicated.

I need to figure this out, but am going nuts with it. If anyone has an idea or two they'd care to toss my way, I would be happy.

Thanks one more time, in advance!!

View 1 Replies View Related

Modules & VBA :: Loop Through Table And Create File Names

Oct 22, 2014

I have a VBA routine that runs some queries and then creates a report as a PDF document using my virtual PDF printer. At this point it brings up the Save As dialog and I give the file a name and select a folder to store it in.

But I run this report 30 times for 30 different parameters. The parameters are obtained from a table which contains values such as Cancer, Diabetes, Stroke

-I always name the PDF file according to this value.
-I always choose the same folder.
-I always overwrite the reports I produced last month (copies have been sent elsewhere by then).

how can I get VBA to cycle through this code 30 times, each time selecting the next value from my table and creating/overwriting those files without the need for me to tell it the filename and path?

Code:
Private Sub lstSpecialties_DblClick(Cancel As Integer)

At the moment I am running this code by double-clicking an entry in the Specialty listbox, 'but I would prefer the whole thing to run multiple times for as many Specialties as exist in the table '(currently 30 but could be more in time)

'Warnings off
DoCmd.SetWarnings False
'Make the tables needed for the cumulative queries
DoCmd.OpenQuery "Spec 002 Monthly recruits - part 2 - make table" Each of these queries
DoCmd.OpenQuery "Spec 005 Monthly recruits - part 2 - make table" uses the Specialty selected above
DoCmd.OpenQuery "Spec 022 ABF previous year - part 2 - make table" as a parameter to get
DoCmd.OpenQuery "Spec 025 ABF current year - part 2 - make table" the right data for the report

[code]....

View 5 Replies View Related

Queries :: Create A Field Using IIF Function

Jan 28, 2014

I am trying to , create a field using the IIf function that will display a $250 bonus for agents every time they sell a car for at least $20,000. Otherwise, the function will return a 0. Name the field Bonus. I put in Bonus: IIf(SalePrice >= "20,000" Then + "250",True, 0) and it is saying that I have an improper syntax.

View 2 Replies View Related

Queries :: How To Create A Quarter Field In A Table

Jul 12, 2013

I have a Date field in the format X/XX/2012 for all my records.

I want to create a field that labels each record according to its quarter. So if a date is 3/29/2012, I'd want the corresponding field entry to be: Q1 2012. If it's 3/29/2013, I'd want it to be: Q1 2013, etc.

I guess I would run an update query, but I don't know how to build the proper expression in order to update my table with a new field.

I have figured out how to create a quarter #, but I actually need output in the format mentioned above.

View 10 Replies View Related

Queries :: How To Create Total Cost Field

Oct 27, 2014

I have a table called Price list, and in it I have two fields, one called Service and The other called cost. The services are listed and their matching prices are listed beside.

In another table called appointments, when making an appointment, I have linked the information so that I can choose from a dropdown from the price list table, under Service type.

I need to be able to create a receipt for the appointment. How can I do that in a query format?

View 1 Replies View Related

Queries :: Create Numerical Sequence Based On Second Field

Aug 30, 2014

Have two tables: Assignment and StudentHeader - they are related by AssignmentGUID

Have the SQL:

SELECT StudentHeader.[Student ID], StudentHeader.GUID
FROM Assignment INNER JOIN StudentHeader ON Assignment.GUID = StudentHeader.[Assignment GUID]
WHERE (((Assignment.[Assignment Type])="Q") AND ((Assignment.[Assignment Number])=2))
GROUP BY StudentHeader.[Student ID], StudentHeader.GUID
ORDER BY StudentHeader.[Student ID], StudentHeader.GUID;

This returns:

Student IDGUID
al003072274
al154636303
al154636463
al595048272
al941626429
am180614426
am750033300
am750033462

I want a third field - Sequence - based on the Student ID and GUID, therefore

Student IDGUIDSequence
al0030722741
al1546363031
al1546364632
al5950482721
al9416264291
am1806144261
am7500333001
am7500334622

View 14 Replies View Related

Queries :: Create Separate Columns From Same Field And Table

Apr 9, 2013

I have 1 table that I duplicated to make 3 tables total. I did this b/c I am trying to create separate columns from the same field and table. The field is Workorder. Each workorder list the workorder number followed by a dash and then code. I am wanting to put all of the workorders with the same code in it's own column.

I have 5 codes that i am searching for. The first column list the workorder and a code (123456789-AD). The second column (123456789-BC). I'm good to this point but my problem occurs next.

The third column i am trying to put 3 types of workorder and it's code in the same column. As follows, (123456789-CD, 123456789-TC, and 123456789-PTC. However, when I do this it takes the results from the 3rd column and applies it to the 3rd column but also the 1st and 2nd column. I tried a UNION query and unless I am doing it incorrectly it does not work.

View 3 Replies View Related

Queries :: Create View (Query) With Only Change In Value For First Field

Jul 16, 2014

Need sorted Query to be used in a Listbox. The attachment shows a made-up view of the objective.

The first column shows the change in value, then blanks for the first column's next rows, until there is a change of value again.

I do something like this in Excel where the first change in value is bolded. This is to make a list box more readable.

View 13 Replies View Related

Queries :: Loop To Create New Tables With Unique Field Values

Sep 20, 2013

I have a table - (Table A) that has 2 fields X and Y. I would like to write a query or script to make two new tables based on the unique values found in field X. In other words, all data where field X = 1 would be written to a new table called "1" and all data wehre field X =2 would be written to a new table called "2".I would like this done automatically.

Table A
Field X Field Y
1 a
1 b
1 c
1 d
2 a
2 b
2 c

View 5 Replies View Related

Queries :: Create And Order By Random Number In Query Field

Jan 2, 2015

I'm trying to create a query that generates random numbers for each record, sorts them by that field, then selects the top record. This should randomize the record being selected.

I can use the Rnd([ID]) function which does appear to generate a random number. Problem is that each time I exit the program and come back in, it always selects the same record. When I remove the Top = 1, to show all the records, every row does have a different random number but it does not appear to be sorting by this field.

If I run the query, here is the number I get: 0.98609316349029

Exit the program, restart, and run the query again: 0.98609316349029

If I refresh the query, the second and third time does appear to be random but the first result is always the same. how to generate truly random numbers?

View 7 Replies View Related

Field Names

Oct 31, 2006

If 2 tables have a field named 'EmployeeID' (for example), are you screwed when it comes to queries and vba, as far as selecting fields / specifying data goes?

Thank you!

View 3 Replies View Related

Field Names

Jul 27, 2006

I need an opinion. I'm new to access so I'm really lost I have to create a database consisting of 20 clients. Then they gave me 4 steps I had to accomplish:

Create a total of all account balances, so the total number of recievables are known.

For each account, calculate the number of days each balance has been outstanding.

Classify the account into 4 groups three late (30,60,90 days overdue) and one current (under 30 days), Total the amount of outstanding recievables for each catagory.

Sort using number of days balance is outstanding as primary sort key and outstanding balance as the second sort key.

My question is should I make a field called Days overdue and a separate one for outstanding balance. It also seems they want me to do calculations in the table. I thought that was not an excepted taboo? Are the 4 goals possible to accomplish in access? Please give me some help!

View 2 Replies View Related

Queries :: Extract Names From Full Name?

Dec 17, 2013

Model Full Name: "Jones, John P." (this was the one not in MS' examples)
Last Name Extract = Jones
lastN = IIf(InStr(1,[Model Full Name],",")=0,"",right([Model Full Name],len([Model Full Name] - (InStr(1,[Model Full Name],",")+2)))First Name Extract = John
firstN = IIf((InStr(1,[Model Full Name],",")+1)=InStrRev([Model Full Name]," "),Right([Model Full Name],Len([Model Full Name])-(InStr(1,[Model Full Name],",")+1)),Mid([Model Full Name],(InStr(1,[Model Full Name],",")+2),(InStrRev([Model Full Name]," ")-1)-(InStr(1,[Model Full Name],","))))

View 1 Replies View Related

Queries :: Finding Names That Appear More Than Once In A Table?

Jul 29, 2013

I have a table with associate names and rankings for each month. I need some way to find out which associates appear in 2 consecutive months with a certain rating. I have a query that will allow you to key in which month you want to look at, but I can't figure out how to write the query to return results only for those associates that appear twice in the months chosen. For example:

John Doe was rated 1.5 in May and 3 in June.
Jane Doe was rated a 1.5 in May and 1.5 in June.

I want a query that will allow me to put in May and June as the criteria as well as < 2 for the rating and only return those that show in both months...

View 5 Replies View Related

Queries :: Column Names Not In Table

May 15, 2015

I have 2 or 3 Queries which are run specifically export data to an Excel file required by external agencies.The queries contain column headings, required by the agencies, which are not derived from Table fields. Obviosly, no record data is produced for these columns.When the queries are run, the dreaded 'Enter Parameter Value' message appears for each to the additional column headings.

The following is a copy of the SQL Code for one such Query;

SELECT DISTINCTROW [Name1] AS Title, [Mail List].[First Name], [Mail List].Surname, [Mail List].[Address 1], [Mail List].PostCode, [Name2] AS [Aggregated Donations], [Name3] AS [Sponsored Event], [Mail List].SubDate, Sum([Mail List].[ Recd]) AS [SumOf Recd]
FROM [Mail List]
GROUP BY [Name1], [Mail List].[First Name], [Mail List].Surname, [Mail List].[Address 1], [Mail List].PostCode, [Name2], [Name3], [Mail List].SubDate, [Mail List].[Gift Aid]
HAVING ((([Mail List].SubDate)>#4/4/2014# And ([Mail List].SubDate)<#4/6/2015#) AND (([Mail List].[Gift Aid])=True));

Is there not some way in which these columns can be defined in Property Sheet such that this error message is prevented?

View 12 Replies View Related

Queries :: Conditional Column Names

May 6, 2014

I am trying to create a rolling twelve month query that will total the months across. I set the query up so that it is a rolling twelve month, but I am having difficulty getting it to list the months across. I would like it to take the first month, list it as a column and show the totals according and the same with each month after. Here is the query that I currently have:

SELECT WIPHistoryTbl.WIP_PART_NUM, WIPHistoryTbl.WIP_MONTH, WIPHistoryTbl.WIP_YEAR, SpinsMonthEndTbl.WEEKS_IN_MONTH, WIPHistoryTbl.WIP_AMOUNT, IIf(Count(Switch([WIP_MONTH_NUM]='06',1))=1,Sum([WIP_AMOUNT]),' ') AS JUNE_TOTALS
FROM SpinsMonthEndTbl INNER JOIN WIPHistoryTbl ON (SpinsMonthEndTbl.SPINS_YEAR = WIPHistoryTbl.WIP_YEAR) AND (SpinsMonthEndTbl.ACCT_MONTH = WIPHistoryTbl.WIP_MONTH_NUM)
GROUP BY WIPHistoryTbl.WIP_PART_NUM, WIPHistoryTbl.WIP_MONTH, WIPHistoryTbl.WIP_YEAR, SpinsMonthEndTbl.WEEKS_IN_MONTH, WIPHistoryTbl.WIP_AMOUNT, WIPHistoryTbl.WIP_MONTH_NUM, SpinsMonthEndTbl.BEG_DATE, SpinsMonthEndTbl.END_DATE
HAVING (((SpinsMonthEndTbl.BEG_DATE) Between (Now()-365) And (Now())))
ORDER BY WIPHistoryTbl.WIP_YEAR, WIPHistoryTbl.WIP_MONTH_NUM;

I would really like it if the query could look at the BEG_DATE, select the corresponding ACCT_MONTH and show it as the column header.

These are what I would like my results to look like:
PART_NUM | 06_TOTALS | 07_TOTALS | 08_TOTALS . . . . . . . . .
123456789 | 10 | 5 | 15 .

View 2 Replies View Related







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