Newbie Dont Known Where To Start My Query

May 28, 2006

Hello, Really hope someone can help me.
I have 2 lots of info in 1 table - nameley customer address & posting address

I need to print a form that always has the posting address on the same side. but in some cases if the postal address is the same as the customer address then it is not filled in. hope this makes sense:

Please Im Really stuck

View Replies


ADVERTISEMENT

Newbie - Hope I Don't Have To Start Again.

Jan 24, 2008

Hi there. I created some forms using the wizard. But I set up the properties on my form so that the navigation bars don't appear. I only want them to be able to input new records. I also added code on the form_open event to default to adding a new record. But I noticed that if i use my scroll wheel on my mouse, I can still view previous records. How do i prevent any previously saved records from loading?

Also, where do I add a message box to say that the data has been saved? i noticed that when the form is closed by using the X button or when they navigate to another form, data is automatically saved. would this be the after_update method?

Thanks.

View 6 Replies View Related

Access Dont Want To Save Query Changes

Sep 15, 2006

I'm trying to save a change made to a sql statement in an access query but everytime I save it and close the database, when i open it up back again, the query returns back to the old unchange sql statement like it never got saved. I checked the user permissions and they are all checked (no restrictions). Any help would be greatly appreaciated.

View 1 Replies View Related

Start-up Query After Log-in

Apr 23, 2008

In my db I have a password log-in for each user. During the log-in process, I have a query set to run:

Code:SELECT tblSetOut.LogNum, tblSetOut.WoNum, tblSetCont.SetContName, tblSetOut.OrdAssign, tblSetOut.WoStat, tblSetOut.ThirdParty, tblSetOut.DateIn, tblSetOut.DateOut, tblSetOut.ThirdTimeIn, tblSetOut.ThirdTimeOut, (DateDiff("n",[ThirdTimeIn],[ThirdTimeOut]))/60 AS [Release if Greater than 24]FROM tblSetCont INNER JOIN tblSetOut ON tblSetCont.SetContInitials = tblSetOut.SetContInitialsWHERE (((tblSetOut.WoStat) Not Like "released" & "*") AND ((tblSetOut.ThirdParty)=True));
It opens up in read-only form that the user can print or exit out of.

What I need to happen is for the query to run based on the user's log-in name. There are three tables involved (tblSetOut, tblSetCont, and tblSecurity). The tbl SetOut and tblSetCont are joined at the field SetContInitials. The tblSecurity (field SC_NAME) is joined to tblSetCont at SetContName.

For the life of me, I cannot figure out how to capture the log-in name to filter the query.

Thank you in advance

Camille

View 6 Replies View Related

Query Start And End Dates

Jul 26, 2007

I'm new in Databases and Access, so my problem is very simple.
I have a table with three fields: Name (Prim. Key), Start Date (Prim. Key) and Cost.

I want to obtain a query with this fields:
Name
Start Date
End Date (where the End Date would be one day before the next start date)
Cost


Thank you

View 1 Replies View Related

Trying To Convert SQL Query To Access, Don't Know Where To Start

Jul 12, 2005

I just started working for a company the other week and they threw this query onto my lap with an unrealistic deadline. My programming experience is primarily in VB6, so I am not completely familiar with coding Access queries.

I was given code that was written for SQL, and the programmer that came up with it is unfamiliar with Access, so I am stuck trying to decipher this. If anyone could help me out, I would greatly appreciate it, as I am thoroughly confused and don't know where to begin. Here is the programmer's original code:
while exists(select top 1 accNum from NoteFile where patindex('%' + char(10) + '%',dbtrref) > 0)
begin
--Insert note into table
insert into #TL19Note(AcctNumber, Note)
select accNum, (case when patindex('%' + char(10) + '%',
dbtrref) <= 0 then dbtrref else left(dbtrref,patindex('%' + char(10) +
'%',dbtrref)) end)
from NoteFile

--Delete note from Note String
update NoteFile
set dbtrref = right(dbtrref,len(dbtrref)-len(left(dbtrref,patindex('%' + char(10) + '%',dbtrref))))
where len(dbtrref)-len(left(dbtrref,patindex('%' + char(10) +'%',dbtrref))) > 0

--Delete rows with no more notes
delete from NoteFile
where len(dbtrref)-len(left(dbtrref,patindex('%' + char(10) +'%',dbtrref))) <= 0 or patindex('%' +char(10) + '%',dbtrref) <= 0
end

--Eliminates any that are CRLR or just spaces
delete from #TL19Note
where len(Note) < 10

--Update the date
update #TL19Note
set NoteDate =left(Note,patindex('% %',Note)-1),
Note = right(Note,len(Note)-patindex('% %',Note))

--No '@' means no time?
update #TL19Note
set NoteTime = '0000'
where left(Note,1) <> '@'

--delete the '@' - we know which ones have it because NoteTime is null
update #TL19Note
set Note = right(Note,len(Note)-patindex('% %',Note))
where left(Note,1) = '@'

--Update NoteTime, take time out of note
update #TL19Note
set NoteTime = left(Note,2) + substring(note,4,2),
Note = right(Note,len(Note)-patindex('% %',Note))

View 6 Replies View Related

Pass Rpt Start And End Dates To Query

Nov 25, 2005

I'm a couple of years removed from Access and shaking off the rust. I hope someone can help with something that may be obvious but I'm missing.

I'm simply looking to pass the begin and end dates to a query driving reports. The calendar form includes unbound text boxes, txtBeginDate and txtEndDate. My code populates the text boxes correctly; the user clicks on the calendar date, clicks the calendar day, then the Begin (or End) Date control, and each populates the respective textbox.

But when I run the query or report, I'm prompted for the parameters. This is what I have in the query's Date field criteria:

Between [Forms]![frm_Calendar]![txtBeginDate] And [Forms]![frm_Calendar]![txtEndDate]

I'm just drawing blank on what I did several years ago to make this work. If anyone can help, I'm most appreciative.

View 6 Replies View Related

Query That Finds Parts That Start With * Wildcard

Feb 26, 2007

I have a sales invoice table that contains parts that start with *, for example *SPR362.

I need to select only those parts that start with the *, as this is the wildcard in queries how do i select those products that start with it without it being recognised as the wildcard and selecting all records?

The field name is simply: Part

:o

Many Thanks

View 4 Replies View Related

Query Calculating No Of Days Between Start And End Date

Mar 20, 2007

i am trying to run a query from a form which will bring up the no of days difference between the start and end date also on the same form.
The query doesn't bring back any results can someone please guide in what i am doing wrong.
Here is the query
SELECT DateDiff('d',[start date],[end date]) AS [no of days]
FROM [booked property]
WHERE ((([booked property]![start date])=[forms]![booking]![booked property]![start date]) AND (([booked property]![end date])=[forms]![booking]![booked property]![end date]));

Thanks

View 2 Replies View Related

How Do I Start Thinking About This Multiple Criteria Query?

May 29, 2007

Embarrassingly, I'm not even to the point where I can ask a specific question about the query(ies) I think I need.

Here's where I'm starting from and where I want to go... maybe it will make enough sense for somebody to point me in the right direction.

I have sales data that contains line items for every item sold over the past X number of years. For each line, there are six key attributes that I'm concerned with.

For simplicity here's a scaled down example of the data for each line.

PART, PART_FAM, TRANS_DATE, FAM_GROUP, TRANS_AMT, OVS_CODE

For each attribute, there are at least five possibilities.

I have been asked to find monthly sales trends on about 20 unique combinations of these various attributes. An example might be, the monthly sales totals for:


TRANS_DATE = 1/1/06 to 1/31/06
PART_FAM = PIN
FAM_GROUP = 01xx
OVS_CODE = 2

Then a SUM for the TRANS_AMT.


I've set up a query that can give me the information I'm looking for one month at a time, but I want to believe there is a way to have Access do some of the grunt work, rather than me having to change the variables one by one and copy/paste each result into my new file.

Is there some reading or previous posts I could review that might get me thinking about this in the right way?

Thanks in advance!

View 2 Replies View Related

How To Stop Query Execution At The Form Start

Dec 19, 2005

Hi

I am a new user to Access. I created couple of forms using wizard, but when I view them, they show me all the available data by default. I want to stop this, if anyone can help me plz.

RMA

View 5 Replies View Related

Queries :: Possible To Force A Query To Start Table Search At End?

Jan 24, 2014

As the post title says, is it possible to force a query to start its table record search at the end of the table and go backwards? The table I'm searching has hundreds of thousands of records and I want to check if any new records have a field with a value that has already been imported into the table. The duplicates would most likely occur near the end of the table and not the beginning, so I see no reason to waste cycles searching records from the very first record in the table.

View 14 Replies View Related

Query Newbie

Jul 26, 2005

I have been reading this is how I am able to articulate my problem with some degree of knowledge.

I have 3 tables as Follows:

Table 1. [ID]pk, [Contestant Name],[Event],[Category],[Class]

Table 2. [ID]pk, [Judge Name],[Event],[Category]

Table 3. [ID]pk, [Contestant Name],[Event],[Category],[Class],[Score1],[Score2],[Remarks]

Table 3 is a record of score from a specific Judge to a specific contestant. There will be a record for each contestant from each judge that is judging that specific [Event] & [Category]. therefore if there are two judges and two contestants there will 4 records entered into the table.

Problems 1. (I can't get my tables related properly)
I should not have to enter the duplicate information each time I enter a record into the Table3. The common information should be available within the other tables using queries.

Why i think I have problem 1:
There is a many to many relationship here on the parent form what i want is the [Judge Name], [Event], [Category].
On the related Sub form i want to see a query that shows me parts of tables 1,2,3 for each Contestant that is entered in the matching [Event],[Category] combined with the query of 1,2,3 and be able to enter this judges scores against the contestant Name and then when I change to a new judge I may see the same contestants but be able to enter a new score record against that contestant with a different judge.

In English
Assume you are a judge for a contest you have a form in front of you
Parent form Select your Event, Name, Category from a pull down box in the sub form you are presented with a list of Contestants that are on stage. You enter Score1 & Score2 for each Contestant and the record is created.

Judge #2 is doing the same thing
He selects his Event,Name, Category from the pull down menu on the Parent form and walla the subform populates with the same contestants as Judge#1 and he enters his Score1 & Score2 into the subform
and
What we have is 2 Judges, 5 Contestants and 10 Records created into Table3

Sorry for the length but the last part helps me visualize what I am trying to explain.

End result is I can't get it to work is this a job for a union query ?

View 2 Replies View Related

Add Query Help For A Newbie...

Jun 6, 2006

:( anyone pls help...

here's my setup i have 3 tables w/ same field(example Field name: PC)

i need to add all the values to another table because i need to get the quantity..

example Table1: 5 Table2:6 Table3: 7

Table4: 5+6+7 (18 should be in Table4 w/ field name Quantity)

can email me at icetumbler03@yahoo.com tnxx...

really appreciate and need asap.

View 1 Replies View Related

Newbie With Query

Aug 8, 2006

I have two tables

Table1 fields: Date, MoneyIn, MoneyOut, (plus other fields...)
Table2 fields: Date (some <> from Table1, other match), MoneyIn, MoneyOut, (plus other different fields...)

Question: Can I run a query that creates a list with
field1: all dates from Table1 AND Table2
field2: MoneyIn
field3: MoneyOut

Thanks

View 1 Replies View Related

Newbie Query

Jan 16, 2008

Hi,

I have two tables.

1. Customer (Id)
2. Transaction (Customer1Id, Customer2Id)

I want to delete all records in Transaction where Transaction.Customer1Id or Transaction.Customer2Id are not matched against the Customer.Id value.

I realise this query is very simple but I cannot get it to work in Access. Any help would be greatly appreciated!!

Thanks,
Ben.

View 1 Replies View Related

Newbie Needs Query Help

Oct 25, 2004

I work for a nonprofit. Everyone has 10 jobs. I am the only person who uses/has used access. I have a donor database listing names addresses, and different fields for donations made/not made for each year. I do simple queries to pull names from the list that our board members would like to personalize a letter to, and the rest goes to a mailing service for addressing and stuffing of envelopes. This year, we would like to send a different letter to those who have donated in any of the last 3 years. I can pull contact info and the 3 fields (donted 2003, 2002, and 2001) together in a query, but not sure what to make the criteria. If I put >1 (since some of my fields automatically have a zero, and are therefore not null), then I only get those names that have donated all three years. Some may have donated two years ago, and not again, some may have donated only last year, or 2 out of 3 years, etc. I know there must be a way to do this, but can't get my head there having only had basic interaction with access. I know by process of elimination how many there should be, so I will know if it runs correctly. Hope this makes some sense. Bear in mind, I am a novice, and certainly not a software person.

View 3 Replies View Related

Just Dont Add Up

Mar 7, 2006

heres one that just don't add up
from the beginning,
i've got a form that puts data into a table from a text box named txtcomments, the table allows 255 chars to be stored the comments are show later using a copy of the input form, all this works great. now i'm taking this data and inserting it into another table using sql inset in the vb editor so i can play with it and leave the original in tact everything works fine on my test machine but when i transfere the database to the server i am only permitted to enter 127 chars in the text box i've narrowed it down to the sql statement and know that where the error is occuring ive tried deleting things and reinstalling im just going round in circles and when i transfere the database back to the test machine everything works fine the test machine uses access 2003 but the server uses 2000 this is the only differance

any help would be god like

john

ps sql statement as follows looks fine to me,

DoCmd.RunSQL "INSERT INTO tblHistory VALUES([txtcomments]);"

View 3 Replies View Related

I Dont Get It....

Apr 28, 2006

Been using simple access for a while now, and this problem is new on me...

Ive got two tables. One has data listed by OLD MATERIAL number (material) and the other has the new Material Number to convert to...

I wanted to simply add a column onto the table to show the new material number (just like a vlookup in excel)...

the odd thing is, i've done this loads of times before and tis worked... Anyone able to help?? :confused: :confused: :confused:


SELECT [2005 DATA].*, MatConversion.[WDB Material], MatConversion.[wdb name], MatConversion.Category, MatConversion.Conversion
FROM [2005 DATA] LEFT JOIN MatConversion ON [2005 DATA].Mat = MatConversion.[Celtic material No];

View 1 Replies View Related

SUM Function In Query :: Newbie

Apr 5, 2006

Hi all,

Another quick Q - am a newbie at Access!

I am performing the following query:

.Open "SELECT DISTINCT([Date]), SUM([Batch Qty]) As [Batch] FROM [" & TableName & "] " & _
"WHERE [Date] BETWEEN #" & sDate & "# AND #" & eDate & "# " & _
"GROUP BY [Date], [Batch Qty]", cn, , , adCmdText


Data Produced:

29/03/200610
29/03/200620
29/03/2006100
30/03/200660
30/03/200680
30/03/20065
30/03/20065

How do I Sum the Totals for the Dates? So it produces:

29/03/2006130
30/03/2006150

TIA

View 1 Replies View Related

Newbie Needs Help Writing Query

May 17, 2006

OK, I have two tables that have pretty much the same data in them, but, the first table has SOME data that the second table doesn't and I need to get that data into the table that does not have it.

Here's a description of what I want to do:

Table #1 has about 10,000 lines of data with the employee SSN as the ID for the records. In this table are two extra columns of data (HRContact)and(HR ContactCode) that are not always populated in Table #2.

Table #2 has about 300,000 lines of data with the SSN as the ID field. Some of the records that match the SSN's from Table #1 have the data HRContact and HRContactCode, but not all of the records have those fields populated.

So, what I need to happen is for the query to go through Table #1, find the SSN of a record. As it finds each SSN, it goes to Table #2, finds that same record with the same SSN, then looks in the HRContact field to see if there is data there, or if it is Null. If there is data in that field, then it goes on to the next SSN in Table #1 and repeats the preceeding process. If the data in HRContact is Null in Table #2, then it goes back to Table #1 and grabs the HRContact and HRContactCode data for that record and writes it into the HRContact and HRContactCode field for the record in Table #2. the query would repeat this process until it reaches the end of file in Table #1.

I hope this is clear and if you have any questions, please ask me...

Thanks for your help,
Dave

View 1 Replies View Related

Newbie Query Problems

Jul 28, 2006

I have an asset table, an equipment table, and a customer table. The asset and customer table has a field DateOut and equipment table has a field OnHand. I would like the OnHand table to decrement by one each time the DateOut is set to current, Date(). Tried Iif, tried expression builder, now completely lost. Any help would be great.

View 1 Replies View Related

Newbie Help With A Complicated Query

Sep 26, 2006

First off let me say that I'm VERY new to Access. I've been put in charge of administering a large (to me) database and I've just started working with the insides of the database for about 3 weeks now.

The most urgent thing though is I need to make an "Honour Roll" report for the employees, that is, they get pass/fail inspections and I'm trying to create a query that returns all employees that have 10 or more passes IN A ROW, with at least 2 of those passes being a personal evaluation vs. an after the fact quality verification. There's already a query in the database that returns the employee ID, total passes, total fails. I've managed to add the field that includes type of inspection, but I can't seem to find a way to count the number of PE's in the field.

The second issue is getting the query to ignore all inspections prior to their last fail. I think I can work out moving the date of the inspection into the query, but then using it is another story. If it requires a script of some sort, then I'm hopelessly lost. The last programming I did was BASIC back in school... many years ago.

If I were to break it down into a statement, it would be something like this:

If (employee passes) >= 10 since last (employee fail) AND (inspection type="PE") >=2, then send (employee ID) and info to a report.

Any help with this is appreciated, I'm starting to get desperate!

View 2 Replies View Related

Query Code In VBA - Newbie

Oct 5, 2006

In the code of a button, ive got....

Which should be pulling the value in cb1 in the last cat query, but im getting an error saying it cant find the field "|" refered too...

Basically there is a table called Last Cat, and I want to draw the value of cb1 out of it where the catpathid = 5 so i made the query to do that... but now im abit lost....

Me.combo1.Value = [Last Cat Query1]![cb1]

any help would be awesome.

View 1 Replies View Related

Dont Know How To Use Code

Nov 18, 2005

I have a problem that seems like it could be very similar to this post from a few years ago
http://www.access-programmers.co.uk/forums/showthread.php?t=46645&highlight=vba332.dll
My problem is I dont know how to use Access other then open a program. This is for a customer and they dont know how to do it either as someone else devoloped their database.
Basically it looks like the database is corrupt but I can not open it using a newer version of access because it has some permissions and I dont know how to go about making my access "look" like the other computer.
Any help is appreciated
Thanks
James

View 1 Replies View Related

Dont Think Access Can Help, Well Not Sure

Dec 10, 2005

Hi all,

I created a database for my company and it works very well but, I need it or something to track the way I pay comisions. Its a type of multi-level company and pay rates vary. Also, once someone hits the top level they now join in profit sharing. The profit sharing part is the tough part becase say person A is at the top he is a team leader and he gets money not only from his sales, but also from the people in his group below him. It must also be able to pay the correct person if someone quits, say Person D, the system knows that it all off person D's people under him go up to person C now. I hope this isnt to confussing, but im starting to confuss myself as im trying to set this up.

Is access able to keep track of an organization like this or should I try to use something else?

Thanks.

Scott

View 1 Replies View Related







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