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 |
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 |
All times are GMT +1. The time now is 07:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com