We would like to update the route and block fields in the Sybase TableA
with route and block fields in MS Access TableB based on the following conditions:
update tableA
set TableA.block = TableB.block, TableA.route = TableB.route
where format(timeOnly(TableA.ts)) between TableB.tmMin and TableB.tmMax
and TableA.ts between '2005-02-02 04:00:00.000' and '2005-02-03 03:59:00.000'
Can we update a Sybase table directly from MS Access table?
We can export Sybase TableA to MS Access database then try to update. But this would take more steps.
Thanks for any suggestions.
TableA - Sybase Table
bus ts route block
8845 2005-02-02 15:30:00.0 4 103
8845 2005-02-02 16:03:00.0 18 103
8845 2005-02-02 16:11:00.0 18 103
8845 2005-02-02 16:29:00.0 4 103
8845 2005-02-02 16:30:00.0 4 103
8845 2005-02-02 17:00:00.0 4 103
8845 2005-02-02 17:10:00.0 4 103
8845 2005-02-02 16:00:00.0 18 103
8845 2005-02-02 15:33:00.0 18 103
8845 2005-02-02 08:30:00.0 1 103
8845 2005-02-02 07:30:00.0 1 103
8845 2005-02-02 09:30:00.0 1 103
8845 2005-02-02 09:09:00.0 1 103
8845 2005-02-02 09:05:00.0 1 103
8845 2005-02-02 09:00:00.0 1 103
8845 2005-02-02 08:00:00.0 1 103
8845 2005-02-02 11:00:00.0 1 103
8845 2005-02-02 07:00:00.0 1 103
8845 2005-02-02 06:30:00.0 1 103
8845 2005-02-02 06:21:00.0 1 103
8845 2005-02-02 06:17:00.0 1 103
8845 2005-02-02 06:00:00.0 1 103
8845 2005-02-02 05:30:00.0 1 103
8845 2005-02-02 05:00:00.0 1 103
8845 2005-02-02 04:37:00.0 1 103
8845 2005-02-02 11:03:00.0 1 103
8845 2005-02-02 11:11:00.0 1 103
8845 2005-02-02 11:30:00.0 1 103
8845 2005-02-02 12:00:00.0 1 103
8845 2005-02-02 12:30:00.0 1 103
8845 2005-02-02 13:00:00.0 1 103
TableB - MS Access Table
Block tmMin tmMax Route
001-01 04:42 14:09 1
001-01 14:35 16:10 854
001-02 04:51 19:53 1
001-03 04:57 14:20 1
001-03 15:07 15:25 4
001-03 15:33 16:26 18
001-03 16:34 17:32 4
001-03 17:40 18:24 18
001-04 04:53 17:52 1
001-05 05:04 13:24 1
001-05 14:35 15:36 862
001-05 16:01 16:01 5
001-05 16:10 17:08 26
001-05 17:13 18:24 5
with route and block fields in MS Access TableB based on the following conditions:
update tableA
set TableA.block = TableB.block, TableA.route = TableB.route
where format(timeOnly(TableA.ts)) between TableB.tmMin and TableB.tmMax
and TableA.ts between '2005-02-02 04:00:00.000' and '2005-02-03 03:59:00.000'
Can we update a Sybase table directly from MS Access table?
We can export Sybase TableA to MS Access database then try to update. But this would take more steps.
Thanks for any suggestions.
TableA - Sybase Table
bus ts route block
8845 2005-02-02 15:30:00.0 4 103
8845 2005-02-02 16:03:00.0 18 103
8845 2005-02-02 16:11:00.0 18 103
8845 2005-02-02 16:29:00.0 4 103
8845 2005-02-02 16:30:00.0 4 103
8845 2005-02-02 17:00:00.0 4 103
8845 2005-02-02 17:10:00.0 4 103
8845 2005-02-02 16:00:00.0 18 103
8845 2005-02-02 15:33:00.0 18 103
8845 2005-02-02 08:30:00.0 1 103
8845 2005-02-02 07:30:00.0 1 103
8845 2005-02-02 09:30:00.0 1 103
8845 2005-02-02 09:09:00.0 1 103
8845 2005-02-02 09:05:00.0 1 103
8845 2005-02-02 09:00:00.0 1 103
8845 2005-02-02 08:00:00.0 1 103
8845 2005-02-02 11:00:00.0 1 103
8845 2005-02-02 07:00:00.0 1 103
8845 2005-02-02 06:30:00.0 1 103
8845 2005-02-02 06:21:00.0 1 103
8845 2005-02-02 06:17:00.0 1 103
8845 2005-02-02 06:00:00.0 1 103
8845 2005-02-02 05:30:00.0 1 103
8845 2005-02-02 05:00:00.0 1 103
8845 2005-02-02 04:37:00.0 1 103
8845 2005-02-02 11:03:00.0 1 103
8845 2005-02-02 11:11:00.0 1 103
8845 2005-02-02 11:30:00.0 1 103
8845 2005-02-02 12:00:00.0 1 103
8845 2005-02-02 12:30:00.0 1 103
8845 2005-02-02 13:00:00.0 1 103
TableB - MS Access Table
Block tmMin tmMax Route
001-01 04:42 14:09 1
001-01 14:35 16:10 854
001-02 04:51 19:53 1
001-03 04:57 14:20 1
001-03 15:07 15:25 4
001-03 15:33 16:26 18
001-03 16:34 17:32 4
001-03 17:40 18:24 18
001-04 04:53 17:52 1
001-05 05:04 13:24 1
001-05 14:35 15:36 862
001-05 16:01 16:01 5
001-05 16:10 17:08 26
001-05 17:13 18:24 5