Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Macro Creating a variable which is to be used in a SQL in the Mac

Created a variable by using an input box

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

Then used this variable in the where clause of the SQL statemnt in the Macro

eg Date StartDate

Instead of using the variable it tried to put StartDate in the query instead.

How do i make the statement to look at the variable.

Should the format be in a datetime format as well since this field in the
database is of datetime format. How do i then change the variable to a
datetime format

Thanks to anyone who can help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro Creating a variable which is to be used in a SQL in the Mac

see response to previous question

--

HTH

RP

"Jimmy" wrote in message
...
Created a variable by using an input box

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

Then used this variable in the where clause of the SQL statemnt in the

Macro

eg Date StartDate

Instead of using the variable it tried to put StartDate in the query

instead.

How do i make the statement to look at the variable.

Should the format be in a datetime format as well since this field in the
database is of datetime format. How do i then change the variable to a
datetime format

Thanks to anyone who can help



Reply
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
Creating a value from a variable result Darren Excel Discussion (Misc queries) 1 April 19th 10 06:43 PM
creating a variable Abe New Users to Excel 1 April 15th 06 06:41 AM
Macro Creating Variable and using variable in a SQL statement Jimmy Excel Programming 4 October 25th 04 02:36 AM
Creating a formula using the loop variable Spector[_2_] Excel Programming 1 October 22nd 04 10:10 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:39 AM.

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

About Us

"It's about Microsoft Excel"