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 |
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2014-01-15 : 04:31:34
|
hey GuysHope your well Sorry for this basic question, but its really got me stumpedAim - Update #account Last_Post_Date with the [LAST_POSTING_DATE] from the #501 table.Currently My update inst working, But i think its because i haven't joined my #501 on to my #account via the FDMSaccountno this is my queryselect Fdmsaccountno,Parentid,Last_Post_Dateinto #accountfrom [Dim_Outlet]Select Fdmsaccountno,[LAST_POSTING_DATE] Into #501FROM [FDMS].[dbo].[stg_LMPAB501]I got my update as follows --Update -- update #accountset Last_Post_Date = [LAST_POSTING_DATE] from #501where [LAST_POSTING_DATE] > Last_Post_DateLooking for any help avaiable |
|
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2014-01-15 : 04:34:01
|
It maybe update #accountset Last_Post_Date = [LAST_POSTING_DATE] from #501where #501.FDMSAccountNo = #account.FDMSAccountNo |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-01-15 : 04:53:46
|
what if there are multiple values of [LAST_POSTING_DATE] in #501 which is > Last_Post_Date value in #account for the same accountno?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2014-01-15 : 05:01:11
|
HI visakh16There isnt multiple [LAST_POSTING_DATE] . Every Fdmsaccountno has one [LAST_POSTING_DATE] |
 |
|
|
|
|