Results 1 to 20 of 20

Thread: [RESOLVED] SELECT x records from table using the Between command

Threaded View

  1. #11
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: SELECT x records from table

    It'll make it really hard down the road when you need to add functionality. I guess you can cross that bridge when you get there.

    This should work for you (mind you, I don't have your data model nd couldn't test it. You may need to make slight modifications):
    Code:
    SELECT * FROM Audit_Split WHERE Audit_Split.Tran_Number in 
    	(SELECT Audit_Header.Tran_Number FROM Audit_Header WHERE Audit_Header.TranNumber 
    	between Audit_Header.Tran_Number-1 AND Audit_Header.Tran_Number + Audit_Header.Item_Count-1
    Edit: I changed it to use AND
    Last edited by sevenhalo; Dec 23rd, 2005 at 05:19 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width