MS Access (OLEDB) UPDATE Table under multiple conditions -


hello , apologies seeming simplicity of question some, mediocre programmer @ best , dealing critical data here.

i trying update 1 column (parchivestatus) in table (image) depending on whether status (parchivestatus) ((100 or 200) , ((timestamp>'2014-11-14 00:00:00') , (timestamp<'2016-02-05 00:00:00'))) in each row. ('captured' name of timestamp column)

anything before , after 2 dates cannot touched

i have come 2 variations, neither of work (lol)

a little nudge in right direction highly appreciated.

  1. variation
    update [image] set [parchivestatus]='0' [parchivestatus] = 100 and [captured] between '2014-11-14 00:00:00' and '2016-02-05 00:00:00';

  2. variation
    update [image] set [parchivestatus]='0' [parchivestatus]=100 and [captured]>'2014-11-14 00:00:00';

and friend told me this
3. variation update (select * image parchivestatus = 100) set parchivestatus=0 captured between '2014-11-14 00:00:00' and '2016-02-05 00:00:00'

i should maybe mention date/time stamp in table not available in other "format" 1 in query, meaning has formatted yyyy-mm-dd hh:mm:ss (24 hour format) , honest not sure if can use format in single-line query (which way requirement solution, can send single line updates database)

thank kind soul helping me out on this.

solution

update [image] set [parchivestatus] = 0 [parchivestatus] = 100 , [captured] between #2014-11-14# , #2015-12-31# 

don't know why try update string. , change "dates" true date values in table. then:

update      [image]  set      [parchivestatus] = 0       [parchivestatus] = 100      ,      [captured] > #2014-11-14 00:00:00#; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -