M
mcl
At work I use access with ODBC to connect to our oracle database. I'm a
meteorologist. I pull down data for a particular station and can crunch all
kinds of climate data for it. Anyway, to speed things up I use a pass
through query as the front end of a make table query. Normally I like to use
brackets [] with prompt to ask for a requested station number. In the
example below the "Block Station Number" (BLKSTN) is 388950. I have to edit
the pass through query to change the number. Is there any way I can prompt
for BLKSTN number using modules?
I must say I don't know VBA. The only thing I know about modules is it's one
of the object choices. I learned a few weeks ago that there is a compiler
after seeing something about it in these newsgroups. (So I would have to
compile anything before running it?).
Anyway, what would it take under modules? How would I have to edit my pass
through query to link to it? Would I have to do anything special to run it?
Compile it?
The last "basic" programming I ever did was in the early 80's with TI
Extended Basic on my old TI 99/4a computer.
Pass through query:
Select BLKSTN,LATITUDE ,LONGITUDE ,CALLLETTER, NETWORKTYPE, PLATFORMID,
OBSERVATIONTIME,WINDDIRECTION ,WINDSPEED ,WINDSPEEDQC,CLOUDCEILING
,CLOUDCAVOK ,VISIBILITY ,AIRTEMPERATURE,AIRTEMPERATUREQC
,DEWPOINTTEMPERATURE ,DEWPOINTTEMPERATUREQC,SEALEVELPRESSURE
,SEALEVELPRESSUREQC,PRECIPAMOUNT1, OBSERVATIONPERIODPP1, PRECIPAMOUNT2,
OBSERVATIONPERIODPP2 ,PASTMANUAL1 ,PASTMANUAL1QC,PASTMANUAL2
,PASTMANUAL2QC,WXPASTPERIOD1, PASTAUTOMATED1,PASTAUTOMATED1QC,
PRESENTMANUAL1,
PRESENTMANUAL1QC,PRESENTMANUAL2,PRESENTMANUAL2QC,PRESENTAUTOMATED,
PRESENTAUTOMATEDQC,CLOUDCOVER ,ALTIMETERSETTING ,ALTIMETERSETTINGQC,
STATIONPRESSURE, STATIONPRESSUREQC, WINDGUSTSPEED, WINDGUSTSPEEDQC, from
SFC_OBS where BLKSTN in(388950) order by OBSERVATIONTIME;
Append Table Query:
INSERT INTO clst_station ( BLKSTN, LATITUDE, LONGITUDE, NETWORKTYPE,
PLATFORMID, OBSERVATIONTIME, [Year], [Month], [Day], [Hour], [Minute],
WINDDIRECTION, wspdkts, WINDSPEEDQC, cighgtft, CLOUDCAVOK, vsbysmi, TempF,
AIRTEMPERATUREQC, DewpF, DEWPOINTTEMPERATUREQC, SEALEVELPRESSURE,
SEALEVELPRESSUREQC, prcp1in, OBSERVATIONPERIODPP1, prcp2in,
OBSERVATIONPERIODPP2, PASTMANUAL1, PASTMANUAL1QC, PASTMANUAL2,
PASTMANUAL2QC, WXPASTPERIOD1, PASTAUTOMATED1, PASTAUTOMATED1QC,
PRESENTMANUAL1, PRESENTMANUAL1QC, PRESENTMANUAL2, PRESENTMANUAL2QC,
PRESENTAUTOMATED, PRESENTAUTOMATEDQC, CLOUDCOVER, ALTIMETERSETTING,
ALTIMETERSETTINGQC, STATIONPRESSURE, STATIONPRESSUREQC, gustkts,
WINDGUSTSPEEDQC, sstC, sstF, e, es, RH, TIME_CONV ) SELECT
sfc_obs_pass_through.BLKSTN, sfc_obs_pass_through.LATITUDE,
sfc_obs_pass_through.LONGITUDE, sfc_obs_pass_through.NETWORKTYPE,
sfc_obs_pass_through.PLATFORMID, sfc_obs_pass_through.OBSERVATIONTIME,
Year([OBSERVATIONTIME]) AS [Year], Month([OBSERVATIONTIME]) AS [Month],
Day([OBSERVATIONTIME]) AS [Day], Hour([OBSERVATIONTIME]) AS [Hour],
Minute([OBSERVATIONTIME]) AS [Minute],
sfc_obs_pass_through.WINDDIRECTION, CDbl([WINDSPEED]*1.943844) AS wspdkts,
sfc_obs_pass_through.WINDSPEEDQC, CDbl([CLOUDCEILING]*3.28) AS cighgtft,
sfc_obs_pass_through.CLOUDCAVOK, CDbl([VISIBILITY]/1609) AS vsbysmi,
CDbl([AIRTEMPERATURE]*1.8+32) AS TempF,
sfc_obs_pass_through.AIRTEMPERATUREQC,
CDbl([DEWPOINTTEMPERATURE]*1.8+32) AS DewpF,
sfc_obs_pass_through.DEWPOINTTEMPERATUREQC,
sfc_obs_pass_through.SEALEVELPRESSURE,
sfc_obs_pass_through.SEALEVELPRESSUREQC, CDbl([PRECIPAMOUNT1]/25.4) AS
prcp1in, sfc_obs_pass_through.OBSERVATIONPERIODPP1,
CDbl([PRECIPAMOUNT2]/2.54) AS prcp2in,
sfc_obs_pass_through.OBSERVATIONPERIODPP2,
sfc_obs_pass_through.PASTMANUAL1, sfc_obs_pass_through.PASTMANUAL1QC,
sfc_obs_pass_through.PASTMANUAL2, sfc_obs_pass_through.PASTMANUAL2QC,
sfc_obs_pass_through.WXPASTPERIOD1, sfc_obs_pass_through.PASTAUTOMATED1,
sfc_obs_pass_through.PASTAUTOMATED1QC,
sfc_obs_pass_through.PRESENTMANUAL1,
sfc_obs_pass_through.PRESENTMANUAL1QC,
sfc_obs_pass_through.PRESENTMANUAL2,
sfc_obs_pass_through.PRESENTMANUAL2QC,
sfc_obs_pass_through.PRESENTAUTOMATED,
sfc_obs_pass_through.PRESENTAUTOMATEDQC,
sfc_obs_pass_through.CLOUDCOVER, sfc_obs_pass_through.ALTIMETERSETTING,
sfc_obs_pass_through.ALTIMETERSETTINGQC,
sfc_obs_pass_through.STATIONPRESSURE,
sfc_obs_pass_through.STATIONPRESSUREQC, CDbl([WINDGUSTSPEED]*1.943844) AS
gustkts, sfc_obs_pass_through.WINDGUSTSPEEDQC,
6.11*(10^((7.567*[DEWPOINTTEMPERATURE])/(239.7+[DEWPOINTTEMPERATURE])))
AS e, 6.11*(10^((7.567*[AIRTEMPERATURE])/(239.7+[AIRTEMPERATURE]))) AS es,
Round(100*[e]/[es],1) AS RH, MSC_ADMIN_WEATHER_STATION.TIME_CONV
FROM sfc_obs_pass_through INNER JOIN MSC_ADMIN_WEATHER_STATION ON
(sfc_obs_pass_through.PLATFORMID = MSC_ADMIN_WEATHER_STATION.PLATFORMID)
AND (sfc_obs_pass_through.NETWORKTYPE =
MSC_ADMIN_WEATHER_STATION.NETWORKTYPE) AND (sfc_obs_pass_through.BLKSTN =
MSC_ADMIN_WEATHER_STATION.BLKSTN) ORDER BY sfc_obs_pass_through.BLKSTN,
sfc_obs_pass_through.OBSERVATIONTIME;
meteorologist. I pull down data for a particular station and can crunch all
kinds of climate data for it. Anyway, to speed things up I use a pass
through query as the front end of a make table query. Normally I like to use
brackets [] with prompt to ask for a requested station number. In the
example below the "Block Station Number" (BLKSTN) is 388950. I have to edit
the pass through query to change the number. Is there any way I can prompt
for BLKSTN number using modules?
I must say I don't know VBA. The only thing I know about modules is it's one
of the object choices. I learned a few weeks ago that there is a compiler
after seeing something about it in these newsgroups. (So I would have to
compile anything before running it?).
Anyway, what would it take under modules? How would I have to edit my pass
through query to link to it? Would I have to do anything special to run it?
Compile it?
The last "basic" programming I ever did was in the early 80's with TI
Extended Basic on my old TI 99/4a computer.
Pass through query:
Select BLKSTN,LATITUDE ,LONGITUDE ,CALLLETTER, NETWORKTYPE, PLATFORMID,
OBSERVATIONTIME,WINDDIRECTION ,WINDSPEED ,WINDSPEEDQC,CLOUDCEILING
,CLOUDCAVOK ,VISIBILITY ,AIRTEMPERATURE,AIRTEMPERATUREQC
,DEWPOINTTEMPERATURE ,DEWPOINTTEMPERATUREQC,SEALEVELPRESSURE
,SEALEVELPRESSUREQC,PRECIPAMOUNT1, OBSERVATIONPERIODPP1, PRECIPAMOUNT2,
OBSERVATIONPERIODPP2 ,PASTMANUAL1 ,PASTMANUAL1QC,PASTMANUAL2
,PASTMANUAL2QC,WXPASTPERIOD1, PASTAUTOMATED1,PASTAUTOMATED1QC,
PRESENTMANUAL1,
PRESENTMANUAL1QC,PRESENTMANUAL2,PRESENTMANUAL2QC,PRESENTAUTOMATED,
PRESENTAUTOMATEDQC,CLOUDCOVER ,ALTIMETERSETTING ,ALTIMETERSETTINGQC,
STATIONPRESSURE, STATIONPRESSUREQC, WINDGUSTSPEED, WINDGUSTSPEEDQC, from
SFC_OBS where BLKSTN in(388950) order by OBSERVATIONTIME;
Append Table Query:
INSERT INTO clst_station ( BLKSTN, LATITUDE, LONGITUDE, NETWORKTYPE,
PLATFORMID, OBSERVATIONTIME, [Year], [Month], [Day], [Hour], [Minute],
WINDDIRECTION, wspdkts, WINDSPEEDQC, cighgtft, CLOUDCAVOK, vsbysmi, TempF,
AIRTEMPERATUREQC, DewpF, DEWPOINTTEMPERATUREQC, SEALEVELPRESSURE,
SEALEVELPRESSUREQC, prcp1in, OBSERVATIONPERIODPP1, prcp2in,
OBSERVATIONPERIODPP2, PASTMANUAL1, PASTMANUAL1QC, PASTMANUAL2,
PASTMANUAL2QC, WXPASTPERIOD1, PASTAUTOMATED1, PASTAUTOMATED1QC,
PRESENTMANUAL1, PRESENTMANUAL1QC, PRESENTMANUAL2, PRESENTMANUAL2QC,
PRESENTAUTOMATED, PRESENTAUTOMATEDQC, CLOUDCOVER, ALTIMETERSETTING,
ALTIMETERSETTINGQC, STATIONPRESSURE, STATIONPRESSUREQC, gustkts,
WINDGUSTSPEEDQC, sstC, sstF, e, es, RH, TIME_CONV ) SELECT
sfc_obs_pass_through.BLKSTN, sfc_obs_pass_through.LATITUDE,
sfc_obs_pass_through.LONGITUDE, sfc_obs_pass_through.NETWORKTYPE,
sfc_obs_pass_through.PLATFORMID, sfc_obs_pass_through.OBSERVATIONTIME,
Year([OBSERVATIONTIME]) AS [Year], Month([OBSERVATIONTIME]) AS [Month],
Day([OBSERVATIONTIME]) AS [Day], Hour([OBSERVATIONTIME]) AS [Hour],
Minute([OBSERVATIONTIME]) AS [Minute],
sfc_obs_pass_through.WINDDIRECTION, CDbl([WINDSPEED]*1.943844) AS wspdkts,
sfc_obs_pass_through.WINDSPEEDQC, CDbl([CLOUDCEILING]*3.28) AS cighgtft,
sfc_obs_pass_through.CLOUDCAVOK, CDbl([VISIBILITY]/1609) AS vsbysmi,
CDbl([AIRTEMPERATURE]*1.8+32) AS TempF,
sfc_obs_pass_through.AIRTEMPERATUREQC,
CDbl([DEWPOINTTEMPERATURE]*1.8+32) AS DewpF,
sfc_obs_pass_through.DEWPOINTTEMPERATUREQC,
sfc_obs_pass_through.SEALEVELPRESSURE,
sfc_obs_pass_through.SEALEVELPRESSUREQC, CDbl([PRECIPAMOUNT1]/25.4) AS
prcp1in, sfc_obs_pass_through.OBSERVATIONPERIODPP1,
CDbl([PRECIPAMOUNT2]/2.54) AS prcp2in,
sfc_obs_pass_through.OBSERVATIONPERIODPP2,
sfc_obs_pass_through.PASTMANUAL1, sfc_obs_pass_through.PASTMANUAL1QC,
sfc_obs_pass_through.PASTMANUAL2, sfc_obs_pass_through.PASTMANUAL2QC,
sfc_obs_pass_through.WXPASTPERIOD1, sfc_obs_pass_through.PASTAUTOMATED1,
sfc_obs_pass_through.PASTAUTOMATED1QC,
sfc_obs_pass_through.PRESENTMANUAL1,
sfc_obs_pass_through.PRESENTMANUAL1QC,
sfc_obs_pass_through.PRESENTMANUAL2,
sfc_obs_pass_through.PRESENTMANUAL2QC,
sfc_obs_pass_through.PRESENTAUTOMATED,
sfc_obs_pass_through.PRESENTAUTOMATEDQC,
sfc_obs_pass_through.CLOUDCOVER, sfc_obs_pass_through.ALTIMETERSETTING,
sfc_obs_pass_through.ALTIMETERSETTINGQC,
sfc_obs_pass_through.STATIONPRESSURE,
sfc_obs_pass_through.STATIONPRESSUREQC, CDbl([WINDGUSTSPEED]*1.943844) AS
gustkts, sfc_obs_pass_through.WINDGUSTSPEEDQC,
6.11*(10^((7.567*[DEWPOINTTEMPERATURE])/(239.7+[DEWPOINTTEMPERATURE])))
AS e, 6.11*(10^((7.567*[AIRTEMPERATURE])/(239.7+[AIRTEMPERATURE]))) AS es,
Round(100*[e]/[es],1) AS RH, MSC_ADMIN_WEATHER_STATION.TIME_CONV
FROM sfc_obs_pass_through INNER JOIN MSC_ADMIN_WEATHER_STATION ON
(sfc_obs_pass_through.PLATFORMID = MSC_ADMIN_WEATHER_STATION.PLATFORMID)
AND (sfc_obs_pass_through.NETWORKTYPE =
MSC_ADMIN_WEATHER_STATION.NETWORKTYPE) AND (sfc_obs_pass_through.BLKSTN =
MSC_ADMIN_WEATHER_STATION.BLKSTN) ORDER BY sfc_obs_pass_through.BLKSTN,
sfc_obs_pass_through.OBSERVATIONTIME;