Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default ODBC-coupling SQL questions

Hi,

We are uploading data from an Infoplus21 database using the ODBC coupling.
The data is:
- The fields are Name, A production number and the date-time
- The sampletime of the data is 1 minute in the Infoplus21 database - the
format of the time-date is"DD-MMM-YYYY hh:mm:ss" ( 12-Oct-2007 01:40:00 )

What I want is:
- I just want to have data of every 5 minutes or even better when the
production number changes = IP_PVDef_2.IP_TREND_CMMNT ( see SQL-string )
- The SQL-string looks like:
==
SELECT IP_PVDef_2.NAME, IP_PVDef_2.IP_TREND_CMMNT,
IP_PVDef_2.IP_TREND_CMMNT_TIME
FROM IP_PVDef_2 IP_PVDef_2
WHERE (IP_PVDef_2.NAME='06Lotnummer') AND
(IP_PVDef_2.IP_TREND_CMMNT_TIME'01-dec-07 00:00:00' And
IP_PVDef_2.IP_TREND_CMMNT_TIME<'01-jan-08 00:00:00')
ORDER BY IP_PVDef_2.IP_TREND_CMMNT_TIME
==

How to change the SQL-string that it takes the 5 minutes or the change op
the IP_PVDef_2.IP_TREND_CMMNT into account?
I have my start and end date in my Excel-workbook, How can I link those
fields in my SQL-string?

thanks for your support
Sven

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default ODBC-coupling SQL questions

Hi,

Concatenate the SQL string with your variable using "&"

"SELECT IP_PVDef_2.NAME, IP_PVDef_2.IP_TREND_CMMNT, " & _
"IP_PVDef_2.IP_TREND_CMMNT_TIME " & _
"FROM IP_PVDef_2 IP_PVDef_2 " &
"WHERE (IP_PVDef_2.NAME='06Lotnummer') AND " & _
"(IP_PVDef_2.IP_TREND_CMMNT_TIME'" & range(startteime) & "' And " & _
"IP_PVDef_2.IP_TREND_CMMNT_TIME<'& range(endtime) & "' )"& _
"ORDER BY IP_PVDef_2.IP_TREND_CMMNT_TIME"

HTH
--
Regards

Jean-Yves Tfelt
Europe


"Sven" wrote:

Hi,

We are uploading data from an Infoplus21 database using the ODBC coupling.
The data is:
- The fields are Name, A production number and the date-time
- The sampletime of the data is 1 minute in the Infoplus21 database - the
format of the time-date is"DD-MMM-YYYY hh:mm:ss" ( 12-Oct-2007 01:40:00 )

What I want is:
- I just want to have data of every 5 minutes or even better when the
production number changes = IP_PVDef_2.IP_TREND_CMMNT ( see SQL-string )
- The SQL-string looks like:
==
SELECT IP_PVDef_2.NAME, IP_PVDef_2.IP_TREND_CMMNT,
IP_PVDef_2.IP_TREND_CMMNT_TIME
FROM IP_PVDef_2 IP_PVDef_2
WHERE (IP_PVDef_2.NAME='06Lotnummer') AND
(IP_PVDef_2.IP_TREND_CMMNT_TIME'01-dec-07 00:00:00' And
IP_PVDef_2.IP_TREND_CMMNT_TIME<'01-jan-08 00:00:00')
ORDER BY IP_PVDef_2.IP_TREND_CMMNT_TIME
==

How to change the SQL-string that it takes the 5 minutes or the change op
the IP_PVDef_2.IP_TREND_CMMNT into account?
I have my start and end date in my Excel-workbook, How can I link those
fields in my SQL-string?

thanks for your support
Sven

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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
ODBC bnkone Excel Discussion (Misc queries) 0 February 15th 06 09:38 PM
Untraceable coupling to another sheet Maarten Excel Discussion (Misc queries) 4 October 5th 05 01:39 PM
ODBC and VBA [email protected] Excel Programming 0 May 17th 05 05:33 PM


All times are GMT +1. The time now is 04:28 PM.

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"