Arlmachado
Registered User.
- Local time
- Today, 10:58
- Joined
- Mar 9, 2017
- Messages
- 17
I am fairly new to SQL language and I am trying to do some work for Uni in Access. I have three columns: Bindugen, with values shown below, and then blank Columns Code and 33/SDGL:
Bindungen: 33,811, / 811,SDGL,33,/ 33,812,SDGL, / 812,SDGL,/ 811, (etc.)
My main column is Bindungen and I want to fill the others in relation to that one. Basically in the column 33/SDGL I tried to do the Update Case When Statement shown below. It obviously didn't work.
SELECT
FROM Codes;
UPDATE (Codes)
SET 33/SDGL ( CASE
WHEN Bindungen = "*," THEN Allein
WHEN Bindungen = "33,*," Or "*,33," THEN 33
WHEN Bindungen = "SDGL,*," Or "*,SDGL," THEN SDGL
ELSE Both
END);
My goal for the 33/SDGL column is that when Bindungen is: "," = Allein / ",33," Or "33,," = 33 / ",SDGL," Or "SDGL,*," = SDGL
and for the rest = BOTH
Could someone help me write this SQL code?
Also for the Code column, I would like it to find from Bindungen which code is there (eg: 811 or 812). Can someone point me in the right direction?
Bindungen: 33,811, / 811,SDGL,33,/ 33,812,SDGL, / 812,SDGL,/ 811, (etc.)
My main column is Bindungen and I want to fill the others in relation to that one. Basically in the column 33/SDGL I tried to do the Update Case When Statement shown below. It obviously didn't work.
SELECT
FROM Codes;
UPDATE (Codes)
SET 33/SDGL ( CASE
WHEN Bindungen = "*," THEN Allein
WHEN Bindungen = "33,*," Or "*,33," THEN 33
WHEN Bindungen = "SDGL,*," Or "*,SDGL," THEN SDGL
ELSE Both
END);
My goal for the 33/SDGL column is that when Bindungen is: "," = Allein / ",33," Or "33,," = 33 / ",SDGL," Or "SDGL,*," = SDGL
and for the rest = BOTH
Could someone help me write this SQL code?
Also for the Code column, I would like it to find from Bindungen which code is there (eg: 811 or 812). Can someone point me in the right direction?