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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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