Home |
Search |
Today's Posts |
#2
![]() |
|||
|
|||
![]()
Hi,
I would hardcode the SQL Statements (Select, From, Where, Between) in to Global variables as such.... Private Const sqlSelect As String = "SELECT b.OrgID, a.OrgName, " Private Const sqlFrom as String = " FROM tblossevent AS b, tbOrg AS a" Private Const sqlWhere as String = " WHERE " Private Const sqlBetween as String = " BETWEEN convert(varchar, _ getdate()-30, 106) AND convert(varchar,getdate(), 106)" You can then construct your SQL statement fairly easily with the following syntax: Let strSQL = sqlSelect & sqlFrom & sqlWhere & YourVariable & sqlBetween Then you can use strSQL as your SQL string! Does this help? Oli -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extract Data From Textbox | Excel Worksheet Functions | |||
extract data from cells | Excel Worksheet Functions | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions | |||
Combo box copy data | Excel Discussion (Misc queries) | |||
Formula to Extract Data from a Table | Excel Worksheet Functions |