Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL Select Where - formatting
Hi Group.
I got good help earlier, so once again I ask for help. I recorded a macro, where in the query I set DebKart.Sælger = 1 and it worked. Now I want to get this variable from Sheet2!G13. But I don't know how to format the SalesPerson value for the SELECT string to work. Any help ? ------------------------------------------------------ Dim SalesPerson As Integer SalesPerson = Range("Sheet2!G13").Value ' "SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & Chr(13) & "" & Chr(10) & "FROM DebKart DebKart" & Chr(13) & "" & Chr(10) & "WHERE (DebKart.Sælger= SalesPerson)" _ -- Med venlig hilsen Peter Hesselager-Olesen SBS-IT Aps |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL Select Where - formatting
Peter,
You mean like this ? "SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & vbNewLine & "FROM DebKart DebKart" & vbNewLine & "WHERE (DebKart.Sælger=""" & SalePerson & """)........" Also, you can use vbNewLine instead. NickHK "Peter Hesselager" wrote in message ... Hi Group. I got good help earlier, so once again I ask for help. I recorded a macro, where in the query I set DebKart.Sælger = 1 and it worked. Now I want to get this variable from Sheet2!G13. But I don't know how to format the SalesPerson value for the SELECT string to work. Any help ? ------------------------------------------------------ Dim SalesPerson As Integer SalesPerson = Range("Sheet2!G13").Value ' "SELECT DebKart.Konto, DebKart.Navn, DebKart.Sælger" & Chr(13) & "" & Chr(10) & "FROM DebKart DebKart" & Chr(13) & "" & Chr(10) & "WHERE (DebKart.Sælger= SalesPerson)" _ -- Med venlig hilsen Peter Hesselager-Olesen SBS-IT Aps |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting, when select a cell. | Excel Discussion (Misc queries) | |||
Conditional Formatting - Can I select a select with Conditional Formatting? | Excel Worksheet Functions | |||
can not select conditional formatting | Excel Worksheet Functions | |||
Select Case Conditional Formatting Sub? | Excel Discussion (Misc queries) | |||
Select Case for Conditional Formatting | Excel Programming |