Subject | Re: SQL Question |
---|---|
Author | Michael Vilhelmsen <Michael.Vilhelmsen@M |
Post date | 2003-02-25T07:54:55Z |
Thank you.
I solved the problem this with a view like this:
Create View MdrBelastning (
NuDato,
NuSalgKr,
NuAntalEksp,
NuDag,
NuMdr,
NuAar,
Afdeling_id,
UAfd_Navn,
FoDato,
FoSalgKr,
FoAntalEksp,
FoDag,
FoMdr,
FoAar)
as
Select
a.Dato,
a.salgkr,
b.dato,
b.salgkr,
from
tidsreg a, tidsreg b
where
a.art=0 and b.art=1 and
cast(extract(day from a.dato) as varchar(2))=cast(extract(day from
b.dato) as varchar(2));
You gave the idea so I tried to solved it with the fields I have.
Thank you.
Michael
--- In ib-support@yahoogroups.com, "Michael Vilhelmsen
<Michael.Vilhelmsen@M...>" <Michael.Vilhelmsen@M...> wrote:
I solved the problem this with a view like this:
Create View MdrBelastning (
NuDato,
NuSalgKr,
NuAntalEksp,
NuDag,
NuMdr,
NuAar,
Afdeling_id,
UAfd_Navn,
FoDato,
FoSalgKr,
FoAntalEksp,
FoDag,
FoMdr,
FoAar)
as
Select
a.Dato,
a.salgkr,
b.dato,
b.salgkr,
from
tidsreg a, tidsreg b
where
a.art=0 and b.art=1 and
cast(extract(day from a.dato) as varchar(2))=cast(extract(day from
b.dato) as varchar(2));
You gave the idea so I tried to solved it with the fields I have.
Thank you.
Michael
--- In ib-support@yahoogroups.com, "Michael Vilhelmsen
<Michael.Vilhelmsen@M...>" <Michael.Vilhelmsen@M...> wrote:
> HiDB
>
> I have a table with a 3 fields in.
> These are LType, Sale og DB.
> LType is either 0 or 1.
>
> I would like to make a select that returns this at each line:
>
> Sale (where LType=0), DB (Where LType=0), Sale (Where LType=1) and
> (Wheremake
> LTYpe=1)
>
> Can I do this ?
>
> MAybe with a view ?
>
> My customer would like to have these numbers on the same line to
> some
> compares.
>
> Regards Michael