LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
benj
 
Posts: n/a
Default extract data from combo box n use it in SQL


not sure if i got the right forum

I have a form created by VBA, and on the form I have a combo box where
the user can specify the month and year. I need to retrieve data from a
database using SQL but i require the input from the combo box to be part
of my condition in my SQL statement to retrieve the data. so any idea
wat is the syntax for writing a SQL statement with the consideration of
the input from the combo box?

right now i have 2 combo box. 1 holding the months, the other holding
the year

SELECT b.OrgID, a.OrgName,eventDate, FROM tblossevent AS b, tbOrg AS a
WHERE eventdate BETWEEN convert(varchar,getdate()-30, 106) AND
convert(varchar,getdate(), 106)

this is wat i have initially
but i wan the eventdate to be obtained from the input of the combo box.
how shd i change my sql coding?


--
benj
------------------------------------------------------------------------
benj's Profile: http://www.excelforum.com/member.php...o&userid=19303
View this thread: http://www.excelforum.com/showthread...hreadid=345762

 
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
Extract Data From Textbox SEA Excel Worksheet Functions 6 February 5th 09 08:21 PM
extract data from cells Nicole L. Excel Worksheet Functions 2 February 2nd 05 08:54 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 05:55 PM
Combo box copy data Steve Excel Discussion (Misc queries) 1 December 22nd 04 12:00 AM
Formula to Extract Data from a Table Macshots Excel Worksheet Functions 2 November 5th 04 06:35 AM


All times are GMT +1. The time now is 01:20 AM.

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"