Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
akas
Starting Member
42 Posts |
Posted - 2008-05-08 : 12:02:25
|
| hi guys,i have to check first the missign dates between dates 1/1/1999 till current date how many dates are missing and for those dates i have set - update quantity=0 for all those missing dates. docdate is datecolumn in saleshsitory and quantity is in salestable. can anybody help me to solve this problem.thanks a lot! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-08 : 12:08:47
|
quote: Originally posted by akas hi guys,i have to check first the missign dates between dates 1/1/1999 till current date how many dates are missing and for those dates i have set - update quantity=0 for all those missing dates. docdate is datecolumn in saleshsitory and quantity is in salestable. can anybody help me to solve this problem.thanks a lot!create view vwviewdateasselect distinct s.sopnumbe,s.soptype,s2.docdate,i.itemdesc as ItemTitle, s.itemnmbr,s.quantity from Salestable sjoin saleshistory s2on s2.sopnumbe=s.sopnumbejoin iv00101 ion s.itemnmbr = i.itemnmbr
DO you want to insert them as new records in sales table? oris it that they already exist and you just need to update field to 0? |
 |
|
|
akas
Starting Member
42 Posts |
Posted - 2008-05-08 : 12:31:43
|
| hi visakh,thanks for replying. well, first step, i have to find missing dates(from my docdate column which is existing in saleshistory table) with using that calendar function.second step: for all those msising dates i have to set quanitty=0.thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-08 : 12:51:05
|
quote: Originally posted by akas hi visakh,thanks for replying. well, first step, i have to find missing dates(from my docdate column which is existing in saleshistory table) with using that calendar function.second step: for all those msising dates i have to set quanitty=0.thanks
so you basically want to insert the new records onto view with quantity 0? |
 |
|
|
|
|
|
|
|