LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Macro Creating Variable and using variable in a SQL statement

Created a Variable where someone enters a date into a inputbox

eg. StartDate = InputBox("Enter Start Date?", "Report")

Then i used this variable in the SQL statement by saying

date=Startdate in the where clause in the VB script.

Instead of using the variable it tried to put "startdate" in the field and
filter by "startdate"

How do i make the the macro use the variable in the SQL statement.

Also should i be changing the date in a date format for the variable in the
inputbox statement. Because it is currently under no format. How can i change
this format.

Thanks If anyone can help
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable statement doobie Excel Discussion (Misc queries) 3 November 11th 09 07:42 AM
Variable in if statement Francis Hookham Excel Worksheet Functions 9 December 12th 07 02:35 PM
IF Statement Variable Jase4now Excel Discussion (Misc queries) 3 September 25th 07 10:48 PM
if than statement has too many variable repke New Users to Excel 1 May 2nd 06 02:00 PM
creating macro to ask for variable info when excel starts Flyriverside Excel Programming 1 April 7th 04 06:32 PM


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"