From: Gunti on 11 Dec 2009 07:36 Hi, excuse me for posting this question for the second time... My last topic was dead, haven't had a response in 3 weeks. I'll try to explain exactly what i'm doing. Two tables A link between those two tables through 'Contract Number' & 'Sales Doc' Creating a new query (Query1) Adding some fields ('Tech Name', 'S Emplcomm name'). Now when i run it, it creates a list of ~ 9000 fields with 'Master Contract', 'Contractnumber', 'Tech Name' & 'S Emplcomm name') I want a new field: Amount where Access counts how often 'Contract#' exists in the query, together with the combination of Tech Name & S Emplcomm name in the query. What i've done: DCount("Master Contract";"[Query1]";"Master Contract=" & [Master Contract] & " AND [Tech name]=""" & [Tech name] & "") as TheCount I named my query 'Query1'. It tells me 'As' is an invalid syntax. Thanks again for everything and i hope i made everything clear! Gunti
From: Douglas J. Steele on 11 Dec 2009 08:10 Where did you type that? If it's in an empty cell on the Fields row in the query builder, put "TheCount:" in front of the DCount statement, rather than "As TheCount" after it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Gunti" <Gunti(a)discussions.microsoft.com> wrote in message news:2A861DE4-1FD3-416A-B209-5C6247020592(a)microsoft.com... > Hi, excuse me for posting this question for the second time... My last > topic > was dead, haven't had a response in 3 weeks. > > I'll try to explain exactly what i'm doing. > > Two tables > A link between those two tables through 'Contract Number' & 'Sales Doc' > Creating a new query (Query1) > > Adding some fields ('Tech Name', 'S Emplcomm name'). > > Now when i run it, it creates a list of ~ 9000 fields with 'Master > Contract', 'Contractnumber', 'Tech Name' & 'S Emplcomm name') > > I want a new field: Amount where Access counts how often 'Contract#' > exists > in the query, together with the combination of Tech Name & S Emplcomm name > in > the query. > What i've done: > > DCount("Master Contract";"[Query1]";"Master Contract=" & [Master Contract] > & > " AND [Tech name]=""" & [Tech name] & "") as TheCount > > I named my query 'Query1'. It tells me 'As' is an invalid syntax. > > Thanks again for everything and i hope i made everything clear! > > Gunti >
|
Pages: 1 Prev: Frequent disconects. officelifeboathang Next: NorthWind Analog For VB.NET? |