SQL (cont from yesterday)

Results 1 to 2 of 2

Thread: SQL (cont from yesterday)

  1. #1
    Join Date
    Dec 1969

    Default SQL (cont from yesterday)

    Hi Folks,<BR> I have a bit of the SQL that I asked from yesterday and now need a hand with the hard part. The sql I have done is thus:<BR><BR>select x.file_reg_id,x.ref_year,x.ref_month,y.pso_amount_ due,y.duos_group<BR>from duos_pso_sfile_process_log x,duos_pso_sfile_data y<BR>where x.file_reg_id = (select max(file_reg_id) from duos_pso_sfile_process_log)<BR>and x.file_reg_id = y.file_reg_id<BR><BR>This gives me the follwing results<BR><BR>FILE_REG_ID REF_ RE PSO_AMOUNT_DUE D<BR>----------- ---- -- -------------- -<BR> 43 2003 01 209280 2<BR> 43 2003 01 28696140 5<BR> 43 2003 01 29700 6<BR> 43 2003 01 48020 3<BR><BR>Now what I need to do is this. In the last column D I need to compare this months PSO Amount to last months PSO amount for D and output it if there is a difference of 10% in the PSO amount.<BR>As usual any help is much appreciated.<BR><BR>Cheers,<BR><BR>Neil.

  2. #2
    Join Date
    Dec 1969

    Default Do you have a real datetime

    column on the duos_pso_sfile_data table instead of just those ref_year and ref_month fields?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts