RichardPrewitt
IS-IT--Management
OK two problems about the same.
Problem #1
-------------
I need a query that will display only dates < 30 days old. Please help me. The query is going to be used on a report. I have the dates entered into fields in the table two different ways. One in format ##/##/#### and another way in 3 seperate fields to do calculations on. Because in VB I had to find when the task has to be completed again and do alot of math for each possiblity
I have a table that is keeping track of every task ever completed and they only want a report genereated that lists just the last 30 days. So the statement that I need would be hopefully in Access so I can just use the query from Access for an Access report.
Problem #2
-------------
Ok another wall that I am hitting is similar to that one.
I am needing to find the oldest of the tasks that are not completed yet and list them descending and return two dates.
I already have them listing descending. I have a field in the table that supplies [lastcomplete] date. I need to come up with a query that based on that date will return the first date(oldest) to the most current date. Now since the newest date can be irrelevant by saying return all dates with incomplete tasks. I just need to also return the oldest date and the newest date in the set. (This being from the one field [lastcomplete]
Another thing that might be need to know is that all of the tasks are incomplete becuase in VB when they finish a task I take the data from this table and put it into a history table and just change the [lastcomplete] date with the date that it was completed and such. They also just want to the last 30 days worth, so maybe something like taking the date in that field and comparing it to [date] (computer generated current date) and if less than 30 days old? Please supply code or examples if you could. I'm just new to programming and this is my first real project using SQL that differs from:
SELECT table1.*, table2.* FROM table2 INNER JOIN table1 ON table2.commonfield = table1.commonfield
So ya I've defiently got alot to learn with SQL.
Any help would be greatly appreciated.
This makes what . . . three things related that I am having problems with lol. O the joys of learning something new in the wonderful world of programming.
Thanks in advance,
Richard
Problem #1
-------------
I need a query that will display only dates < 30 days old. Please help me. The query is going to be used on a report. I have the dates entered into fields in the table two different ways. One in format ##/##/#### and another way in 3 seperate fields to do calculations on. Because in VB I had to find when the task has to be completed again and do alot of math for each possiblity
I have a table that is keeping track of every task ever completed and they only want a report genereated that lists just the last 30 days. So the statement that I need would be hopefully in Access so I can just use the query from Access for an Access report.
Problem #2
-------------
Ok another wall that I am hitting is similar to that one.
I am needing to find the oldest of the tasks that are not completed yet and list them descending and return two dates.
I already have them listing descending. I have a field in the table that supplies [lastcomplete] date. I need to come up with a query that based on that date will return the first date(oldest) to the most current date. Now since the newest date can be irrelevant by saying return all dates with incomplete tasks. I just need to also return the oldest date and the newest date in the set. (This being from the one field [lastcomplete]
Another thing that might be need to know is that all of the tasks are incomplete becuase in VB when they finish a task I take the data from this table and put it into a history table and just change the [lastcomplete] date with the date that it was completed and such. They also just want to the last 30 days worth, so maybe something like taking the date in that field and comparing it to [date] (computer generated current date) and if less than 30 days old? Please supply code or examples if you could. I'm just new to programming and this is my first real project using SQL that differs from:
SELECT table1.*, table2.* FROM table2 INNER JOIN table1 ON table2.commonfield = table1.commonfield
So ya I've defiently got alot to learn with SQL.
Any help would be greatly appreciated.
This makes what . . . three things related that I am having problems with lol. O the joys of learning something new in the wonderful world of programming.
Thanks in advance,
Richard