Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
The full impact of parenthood doesn't hit you until you multiply the
number of your kids by 32 teeth.
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
Querying InSQL from Excel
Human-Machine Interface and SCADA. topic
Posted by tsflstb on 7 June, 2007 - 11:26 pm
I am trying to create an Excel file using the "get external data" via MS Query to acquire plant data from a server running InSQL. The query works with most parameters except for the date. I've had no luck in trying to query between two dates, or even querying for an exact date. I think there may be some issues with the date format Excel uses versus InSQL. Has anyone run across this problem before? Thanks.


Posted by Piotr Kowalski on 9 June, 2007 - 1:25 am
I used to build a SQL query in VBA. For example:

sqlstring = sqlstring & "SET wwEndDate '" & frmRange.txtDate & " 6:30am' "

where frmRange.txtDate is a date string in the form "mm-dd-yy"
After the the SQL query string is complete, I do:

"connstring = _
"ODBC;DSN=SQL;UID=wwUser;PWD=wwUser;APP=MicrosoftR Query;WSID=JAN
SKOWKA;DATABASE="
With ActiveSheet.QueryTables.Add(Connection:=connstring, _
Destination:=Sheets(2).Range("C10"), Sql:=sqlstring)
.Refresh
End With"


Regards,
Piotr Kowalski


Posted by ragup on 28 December, 2007 - 12:59 pm
I have a cell(a1) as 12/01/2007 to be used as a paramter in sqlsgtring. Can you please let me know how it shoud be written??

Thanks,
ragup

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!