Skip to content

Instantly share code, notes, and snippets.

@sancarn
Created June 13, 2018 14:13
Show Gist options
  • Select an option

  • Save sancarn/2bd5ad4136ab293c8168f410f3677756 to your computer and use it in GitHub Desktop.

Select an option

Save sancarn/2bd5ad4136ab293c8168f410f3677756 to your computer and use it in GitHub Desktop.
Alter Table S104 (Add CAB Logical, KST Logical, PLT Logical)
select * from S104 where Adoption_Date <> "" into qNoBlank
select * from qNoBlank where Adoption_Date < CurDate() into qCAB
select * from qNoBlank where Adoption_Date >= CurDate() into qKST1
select * from S104 where Adoption_Date = "" into qBlank
select * from qBlank where Date_Confirmation < CurDate() or dwellings(DWF_Total_m3_per_sec) < 50 into qKST2
select * from qBlank where Date_Confirmation > CurDate() and dwellings(DWF_Total_m3_per_sec) >= 50 into qPLT
update S104 set CAB = 0, KST = 0, PLT = 0
update qCAB set CAB = 1, KST = 1, PLT = 1
update qKST1 set KST = 1, PLT = 1
update qKST2 set KST = 1, PLT = 1
update qPLT set PLT = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment