Link to home
Start Free TrialLog in
Avatar of bode
bode

asked on

returning all records entered in a week

I have two problems with SQL

problem 1

I'm using LiveWire Pro to connect to a DB in MS-SQL.  I need to return all records entered in the last week or the last 10 days or 2 weeks etc. etc.

problem 2

I can entered carriage returns in my textbox which are stored in the DB.  Whenever I retrieve the data from the DB, CR's are stripped out.  I'm not putting the data from the DB back into a textbox - just into a formatted table
ASKER CERTIFIED SOLUTION
Avatar of bret
bret
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bode
bode

ASKER

Thanks Bret

I've actually already solved the problem!  I used the following:

SELECT * FROM mytable WHERE DATEDIFF(DD, mydatefield, GETDATE()) BETWEEN 0 AND 7

This selects all records entered in the last 7 days