View Full Version : about queries


beanbeanbean
11-17-2008, 09:31 PM
hi guys. i was just wonder is there any command in the query to pull out a similiar data from the table.

like for example:

i have 2 different fields. one of this has a data which is aaaaa and the other has a data which is aaaaa00.

i'm trying to create a query which compares the both of them. this means even though aaaaa does not have the 00 at the back, they would still pull it out into the table as it is similar.

i've tried using the Like "*" command but it does not seem to work.


would be really thankful for your help. god bless.

John Big Booty
11-17-2008, 09:35 PM
If you wish to show all the records from a particular table in a query, simply leave the criteria fields blank.

beanbeanbean
11-17-2008, 10:47 PM
yea, but is there a way to pull both the aaaaa data even thought one of them has a 00 behind ?

DCrake
11-17-2008, 11:07 PM
The like statement should be

Like "aaaa*"

Do an Access help on Like to see the different maks available.

raskew
11-17-2008, 11:12 PM
Hi -

...to see the different maks available

What's a mak?

Bob

beanbeanbean
11-17-2008, 11:20 PM
The like statement should be

Like "aaaa*"

Do an Access help on Like to see the different maks available.


hey thanks again dcrake !

but smth odd happened. lol.

my query icon kinda change. at first it was a yellow exclaimation mark that would put a table at the table part of access but now, its icon is kinda like a dual form icon and when i click on it its shows me the data straight away. is there a way i can change it to the yellow exclaimation mark ?

DCrake
11-17-2008, 11:57 PM
What version of Access are you using?

beanbeanbean
11-18-2008, 12:44 AM
access 2003. currently my query looks something like this after alot of testing.


SELECT test1.[Opty Id], test1.[Opty Name], SJ_CIS.NEWCINSFX, test1.[Contact CIN], test1.[Contact CIN SFX], test1.[Create By (Name)], test1.[Created By (Login)], test1.[Opty Created Date], SJ_CIS.JOIN_DATE, test1.[Opty Closed Date], test1.[Closed By (Emp #)], test1.[Referral - Employee #], test1.[Referral - Employee], test1.[Sales Rep], test1.Product
FROM SJ_CIS, test1
WHERE (((test1.[Sales Rep Position]) Like '*INTL*') AND (([test1].[Contact CIN] & [test1].[Contact CIN SFX])=([SJ_CIS].[NEWCINSFX])));


is this because of me taking the data from 2 different tables ?


and i'm so sorry. its a black exclaimation mark. there's a small yellow thingy beside it.

those are my normal queries whereby, they would drop the tables and paste the updated data into the same table. the data is only taken from 1 table.

but for this query its kind of strange as the data appears to me straight in the table form when what i want is to ask it to paste the data into a new table.


so sorry the data base has a bit too much information thus its size limit does not allow me to attach it here.

DCrake
11-18-2008, 01:11 AM
It looks like you don't have an inner join between the two tables in your query.

There is usually one field in each table that links them together, otherwise you will get what is called a cartesian effect. Whereby you get a row for each record in each table.

So you need to join the Primary key in the parent table to the foreign key in the child table.

David

namliam
11-18-2008, 03:05 AM
BeanBeanBean,

Can you PleasePleasePrettyPlease keep questions to a single thread? I think I have seen this question now in atleast 4 or 5 different threads all with the same answer... NO JOIN....

See (atleast)
Here: http://www.access-programmers.co.uk/forums/showthread.php?t=160737
Or: http://www.access-programmers.co.uk/forums/showthread.php?t=160748

I am pretty sure if I search hard enough I will find more...