[Solved] Simple VBA Select Query

Here is one way to do it: sSQL = “SELECT Variable FROM GroupTable ” Set rs = CurrentDb.OpenRecordset(sSQL) On Error GoTo resultsetError dbValue = rs!Variable MsgBox dbValue, vbOKOnly, “RS VALUE” resultsetError: MsgBox “Error Retrieving value from database”,VbOkOnly,”Database Error” solved Simple VBA Select Query

[Solved] nested if-statement [closed]

SELECT DISTINCT IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)=’H’ And SYSADM_OPERATION.SERVICE_ID=’HEAT TREAT’,SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)=’C’ And SYSADM_OPERATION.SERVICE_ID=’CLOTHING’ Or SYSADM_OPERATION.SERVICE_ID=’ZINC PLATING’,SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)=’G’ And SYSADM_OPERATION.SERVICE_ID=’GRINDING’,SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>’G’ Or RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>’H’ Or RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>’C’ And SYSADM_OPERATION.SERVICE_ID Is Not Null,SYSADM_OPERATION.SERVICE_ID, IIf(SYSADM_OPERATION.SERVICE_ID<>’HEAT TREAT’ And SYSADM_OPERATION.SERVICE_ID<>’COATING’ And SYSADM_OPERATION.SERVICE_ID<>’ZINC PLATING’ And SYSADM_OPERATION.SERVICE_ID<>’GRINDING’,SYSADM_OPERATION.SERVICE_ID))))) FROM SYSADM_OPERATION INNER JOIN TBL_PO_SERVICE_ORDER_INPUT ON ([TBL_PO_SERVICE_ORDER_INPUT].WO_LOT_ID=[SYSADM_OPERATION].WORKORDER_LOT_ID) AND ([TBL_PO_SERVICE_ORDER_INPUT].WO_BASE_ID=[SYSADM_OPERATION].WORKORDER_BASE_ID); 0 solved nested if-statement [closed]

[Solved] DBgrid not showing changes and show error when to try update – Insufficient key column information for updating or refreshing [closed]

My guess is that: does not have the recent changes is because the data has not been posted. And cannot be from what I can see. You’re trying to insert and update tuples from two tables, but you fetched only a foreign key of a detail table. Imagine, that you’d like to update this resultset … Read more

[Solved] Creating MySQL query from access query

Assuming the first query to run is named qryAgreedToServiceOrUnenrolled. Try nesting the first SQL in the second’s FROM clause. Can replace qryAgreedToServiceOrUnenrolled with some other alias everywhere it is referenced. SELECT qryAgreedToServiceOrUnenrolled.patient_id, dispositions.description, dispositions.member_status FROM (( (SELECT DISTINCT t.patient_id, MAX(t.id) AS MaxOfid FROM transactions AS t INNER JOIN disposition_transaction_type AS dt ON t.disposition_transaction_type_id = dt.id … Read more

[Solved] Selecting distinct values from multiple column of a table with their count

Get all column values to one row and find the count SQL SERVER ;WITH CTE AS ( SELECT COL1 Name FROM YOURTABLE UNION ALL SELECT COL2 FROM YOURTABLE UNION ALL SELECT COL3 FROM YOURTABLE UNION ALL SELECT COL4 FROM YOURTABLE UNION ALL SELECT COL6 FROM YOURTABLE UNION ALL SELECT COL7 FROM YOURTABLE ) SELECT DISTINCT … Read more

[Solved] C# Update + with “label” [closed]

I think you are looking for this: string query = string.Format(@”Update tbPegawai set Total_Gaji = Total_Gaji + “”{0}”” where Kode_Pegawai = “”{1}”””,Label.Text,textBoxKDPegawai.Text); 1 solved C# Update + with “label” [closed]

[Solved] I need to join 2 databases, with 2 tables each

With a UNION ALL you can get 1 combined resultset from 2 selects. Then you can group that and SUM the amounts per date. So you’re probably looking for something like this: select q.ID, q.Name, nullif(sum(case when q.Date=”2018-05-01″ then q.Amount end), 0) as “5/1/2018″, nullif(sum(case when q.Date=”2018-05-02” then q.Amount end), 0) as “5/2/2018” from ( … Read more