Query returns "-1" instead of actual values.

Steff_DK

Registered User.
Local time
Today, 20:53
Joined
Feb 12, 2005
Messages
110
Check the attached mdb file.

Can't figure out why the query returns -1 instead of the letters that are stored in the table :confused:

Many thanks!

Steff
 

Attachments

The syntax of the subquery in each day is wrong. You need to construct the subquery for each day like this (Day 6 is the example as it returns a positive result):

Code:
(SELECT tblvagter.label
FROM tblusers INNER JOIN tblvagter ON tblusers.user_id = tblvagter.user_id
WHERE (((Format([start_plan],'dd-mm-yyyy'))='06-04-2006') 
AND ((tblvagter.position)="FA"))) AS Day6

HTH
 
Last edited:
A second thought is that you might like to play with Crosstab queries for something like this.
 

Users who are viewing this thread

Back
Top Bottom