|
-
August 3rd, 1999, 07:43 AM
#1
SQL
I have built a database in access and made a query witch works in access.
This query is suppose to get get all [ID] fiels in a table wich have the date 'Dags' and then get all the [name] fields in another table that have the same ID as those chosen earlier. This is suppose to be the source for a data object.
the code I wrote was this:
Data7.RecordSource = "SELECT [Stundartafla Starfsfóls].Kennitala, '"
"' Staff.NAFN FROM [Stundartafla Starfsfóls] '"
"' INNER JOIN Staff ON '"
"' [Stundartafla Starfsfóls].Kennitala = Staff.KT '"
"' WHERE ((([Stundartafla Starfsfóls].Maetir_dags)= '"
"' Dags ))"
and I get the errormessage: Syntax error (missing operataor) in query expression 'staff.NAFN'"
-
August 3rd, 1999, 07:51 AM
#2
Re: SQL
remove all single quotes from your sql string except for:
"WHERE ((([Stundartafla Starfsfóls].Maetir_dags)= '" & Dags & "'))"
I assume that Dags is a program variable not a field name.
-
August 3rd, 1999, 08:26 AM
#3
Re: SQL
You are right but this was just used as a test variable. The real problem seems to be that my program does not see two tables it seems to just look at the [Stundartafla Starfsfóls] and not see any Staff table.
If I try to expain further I have two tables and one variable a date
Table1 has the fields [ID][DATE] (The day a person will be working)
Table2 has the fields [ID][NAME]
and I want to see just the [NAME][ID] of those hwo will be working a sertain day
An I Want this information put into a Data object.
thanks!
your favorit Gosto!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|