WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

I am getting an error in my SQL query.

SenseiiPikaa

New member

0

0%

Status

Offline

Posts

36

Likes

0

Rep

0

Bits

190

8

Months of Service

0%
To select the ID, ad, Miktar, and Tutar from the temporary document details in the warehouse database, you can use the following SQL query:

```
SELECT s.id, s.ad, (CONCAT(FORMAT(SUM(bd.yon * bd.adet_miktar), 3, 'tr_TR')) as Miktar, CONCAT('?', FORMAT(SUM(ISNULL(.tutar_satir, 0)), 2, 'tr_TR')) as Tutar
FROM Temp.dbo.temp_belge_detay as bd
INNER JOIN Toyaplus.dbo.stok s ON s.id = bd.stok_id
WHERE bd.tarih BETWEEN '@bastar' AND '@bittar' AND bd.tnm_lokasyon_id = @lokasyon
GROUP BY s.id, s.ad, s.stok_grup_id, s.alis_fiyat
ORDER BY ad ASC
```

This query retrieves the specified information from the database tables while ensuring the appropriate formatting and grouping.
 

254

6,645

6,665

Top