Adding row for every date between two dates in SQL

I have a table with values for a start and end date. If the start and end date is not the same, I want to duplicate the rows for the dates in between, so that each date has his own row with the same information. Of course I have read many solutions, but could still… Read More Adding row for every date between two dates in SQL

Not equal to number does not include null SQL Server

I have this SQL query in SQL Server for context. SELECT O.OrderID, SUM(P.Quantity) AS SprayGlueCans FROM FCMDB.dbo.FcoOrders O JOIN FCMDB.dbo.FcoStyleGroups SG ON SG.OrderID = O.OrderID JOIN FCMDB.dbo.FcoProducts P ON P.StyleGroupID = SG.StyleGroupID WHERE P.CatalogProductID = 12715 AND O.Shipped = 1 AND MONTH(O.ShipDate) = 8 AND YEAR(O.ShipDate) = 2023 AND O.InstallerID <> 3 AND InstallerID <>… Read More Not equal to number does not include null SQL Server

SQL query not getting correct result in declare set statement in tsql

I have a query as declare @aa varchar(50) set @aa = concat(””,year(getdate())-67,””) select * from dimcustomer where cast(datepart(year,BirthDate) as varchar(50)) = @aa I have datatype for birthdate as varchar(50). But unable to get any results, getting zero records What is the wrong with my query ??? help is appreciated !!! >Solution : First, do NOT… Read More SQL query not getting correct result in declare set statement in tsql

Query SQL Server for JOIN and WHERE

I have problem with my sql query. I want to join 2 table, with condition using where ‘id_pegawai’ and ‘status’ = 1. Table1: SELECT * FROM form_pertambahan_anak Table2: SELECT * FROM peg_dtl_anak WHERE id_pegawai = ‘0000000360’ My Query: SELECT fpa.id_pegawai, fpa.tanggal_pengusulan, fpa.id_anak, pda.id, pda.nama_anak, fpa.deleted_at, fpa.status FROM form_pertambahan_anak fpa INNER JOIN peg_dtl_anak pda ON pda.id_pegawai… Read More Query SQL Server for JOIN and WHERE

Thread synchronizing – almost same expressions but different result

public class MythreadM { public static void main(String[] args) { // TODO Auto-generated method stub Msg m = new Msg(); Mythread thread1 = new Mythread(m); thread1.start(); Mythread thread2 = new Mythread(m); thread2.start(); Mythread thread3 = new Mythread(m); thread3.start(); } } class Mythread extends Thread { private Msg m; Mythread(Msg m) { this.m = m; }… Read More Thread synchronizing – almost same expressions but different result