Where to put the sub-programm, GetOpenFile

G

Guest

Thanks Dick for you're help. My only problem is, and maybe this is a very
simple and stupid question. Where do I put the sub-programm Get open File in
my SQL texture (existing query). (SELECT `Blad1$`.`Cost ctr`,
Sum(`Blad1$`.`Val#in rep#cur#`) AS 'Totale kosten per Costctr'
FROM `Y:\MIJN DOCUMENTEN\Excel bestand te exporteren`.`Blad1$` `Blad1$`
WHERE (`Blad1$`.`D/C`='D') OR (`Blad1$`.`D/C`='C')
GROUP BY `Blad1$`.`Cost ctr`)

.. Because if I put it in, MSquery tells me that he can't display the table
and he can't find the table.
 
T

Tom Ogilvy

fName = GetOpenFileName()
sSQL = _
"SELECT `Blad1$`.`Cost ctr`, " & _
"Sum(`Blad1$`.`Val#in rep#cur#`) AS 'Totale kosten per Costctr'" & _
"FROM `" & fName & "`.`Blad1$` `Blad1$`" & _
"WHERE (`Blad1$`.`D/C`='D') OR (`Blad1$`.`D/C`='C')" & _
"GROUP BY `Blad1$`.`Cost ctr`"

Would build the query string. Not sure how you want to use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top