Getting result Query into table

HV_L

Registered User.
Local time
Today, 13:29
Joined
Dec 23, 2009
Messages
53
Hi,
I have this query which in facts Concatenate a Bill number (factuurnummer)
I want to save this value for later reference, but how to get the value (Factuurnummer) into my table (registratie.factuurnr)?
This is the query that produces the Billing number:
Code:
SELECT Year([datum]) AS jaar, 
 projecten.projectid AS Project,  
 DatePart("ww",[datum],2,2) AS Week,  
 periode.Periode_naam AS Per,  
 [jaar] & [Project] & [Per] & [Week] AS Factuurnummer 
FROM periode, projecten INNER JOIN registratie ON projecten.projectid = registratie.projectid 
WHERE (((registratie.datum) Between [periode].[Periode_startdatum] And [periode].[Periode_einddatum]));
 
Yes have tried both, but I can't get it right.
This is what I have which isnt'working
Code:
UPDATE Facturen, projecten INNER JOIN registratie ON projecten.projectid = registratie.projectid SET registratie.factuurnr = [Facturen].[Factuurnummer]
WHERE (([registratie].[projectid]=[projecten].[projectid]));
It set the same value for all records in registratie while there are differnt for records in Facturen..?? Beats me..
 
You problem lies in the highlighted portion of your SQL;
Code:
UPDATE Facturen, projecten INNER JOIN registratie ON projecten.projectid = registratie.projectid SET registratie.factuurnr = [Facturen].[Factuurnummer]
WHERE (([registratie].[projectid]=[B][COLOR="Red"][projecten].[projectid][/COLOR][/B]));
Your SQL probably needs to look something like;
Code:
UPDATE Facturen, projecten INNER JOIN registratie ON projecten.projectid = registratie.projectid SET registratie.factuurnr = [Facturen].[Factuurnummer]
WHERE (([registratie].[projectid]=[B][COLOR="DarkGreen"][Forms]![YourFormName]![YourControlName][/COLOR][/B]));
This would only update the record related to the current record on your form.
 
Oke Big Booty :-)
Going to try this later this evening. Thanks for replying.
 

Users who are viewing this thread

Back
Top Bottom