Exact gegevens ophalen ExactKoppeling Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=|InitialCatalog|;Data Source=|DataSource|;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=HP-1234567890;Use Encryption for Data=False;Tag with column collation when possible=False SQL SELECT gbkmut.reknr REKNR ,grtbk.oms25_0 REKOMSCHRIJVING ,grtbk.bal_vw REKSOORT ,gbkmut.bkstnr BOEKSTUKNR ,gbkmut.faktuurnr FACTUURNR ,gbkmut.datum DATUM ,gbkmut.periode PERIODE ,Cast( CASE WHEN gbkmut.bdr_hfl >0 THEN gbkmut.bdr_hfl ELSE 0 END as numeric(20,2) ) DEBET ,Cast( CASE WHEN gbkmut.bdr_hfl <0 THEN gbkmut.bdr_hfl * -1 ELSE 0 END as numeric(20,2) ) CREDIT ,gbkmut.btw_code BTWCODE ,gbkmut.oms25 OMSCHRIJVING ,gbkmut.CurrencyCode VALUTA ,1 WISSELKOERS ,gbkmut.dagbknr DAGBOEK ,dagbk.oms25_0 DAGBOEKOMSCHRIJVING ,gbkmut.ID VOLGNR ,gbkmut.datum VERWERKINGSDATUM ,gbkmut.ID REGELNR ,gbkmut.project PROJECTCODE ,CASE WHEN gbkmut.debnr IS NOT NULL THEN 'Debiteur' WHEN gbkmut.crdnr IS NOT NULL THEN 'Crediteur' END RELSOORT ,CASE WHEN gbkmut.debnr IS NOT NULL THEN gbkmut.debnr WHEN gbkmut.crdnr IS NOT NULL THEN gbkmut.crdnr END RELCODE ,CASE WHEN gbkmut.debnr IS NOT NULL THEN deb.cmp_name WHEN gbkmut.crdnr IS NOT NULL THEN crd.cmp_name END RELNAAM ,CASE WHEN gbkmut.debnr IS NOT NULL THEN deb.cmp_fpc WHEN gbkmut.crdnr IS NOT NULL THEN crd.cmp_fpc END RELPC ,CASE WHEN gbkmut.debnr IS NOT NULL THEN deb.cmp_fcity WHEN gbkmut.crdnr IS NOT NULL THEN crd.cmp_fcity END RELPLAATS ,CASE WHEN gbkmut.debnr IS NOT NULL THEN deb.cmp_fctry WHEN gbkmut.crdnr IS NOT NULL THEN crd.cmp_fctry END RELLAND FROM [dbo].[gbkmut] gbkmut left join dbo.grtbk grtbk on gbkmut.reknr = grtbk.reknr left join dbo.dagbk dagbk on gbkmut.dagbknr = dagbk.dagbknr left join dbo.cicmpy deb on gbkmut.debnr = LTRIM( RTRIM( deb.cmp_code ) ) left join dbo.cicmpy crd on gbkmut.crdnr = LTRIM( RTRIM( crd.cmp_code ) ) WHERE gbkmut.bkjrcode = |Boekjaar| AND gbkmut.transtype IN ( 'N' )