I have an SQL query that displays all the customers that backed up within a certain period of time(days). The query looks something like this:<br><br>----<br>StrQuery = "SELECT Customer.CustID,FileDescription.CustId, FileDescription.UploadDate from FileDescription,Customer where FileDescription.CustId = Customer.CustID and not(DateDiff(day, UploadDate, getdate()) > " & "10" & ""<br>----<br><br>the sample of the results looks like this:<br><br>-------------------------------------------<br><br>CustID UploadDate<br>------ ----------<br>36 7/23/00 12:08:01 AM<br>36 7/23/00 12:08:02 AM<br>36 7/24/00 6:18:01 AM<br>36 7/24/00 6:18:02 AM<br>36 7/25/00 10:28:02 AM<br>36 7/25/00 10:28:02 AM<br>36 8/2/00 10:58:03 AM<br>36 8/2/00 10:58:11 AM<br><br>-------------------------------------------<br><br>The above results are for backups within the last 10 days (as the query is setup). My first question is get to query only a unique (one) custID, right now there are 8 custID with the same value showing up? My second question is how do get only the first and last dates backed up within the last 10 days for instance, so from above how do I display 7/23/00 12:08:01 AM and 8/2/00 10:58:11 AM. To help make it clear I want the result to look something like this:<br><br>--------------------------------------------------<br><br>CustID UploadDate(first) UploadDate(last)<br>------ ----------------- -----------------<br><br>36 7/23/00 12:08:01 AM 8/2/00 10:58:11 AM<br><br>--------------------------------------------------<br><br>Another thing that has bugged me recently is that I have a variable called numDays in my asp set to an integer value. When I modify my SQL query to look like this:<br><br>----<br>StrQuery = "SELECT Customer.CustID,FileDescription.CustId, FileDescription.UploadDate from FileDescription,Customer where FileDescription.CustId = Customer.CustID and not(DateDiff(day, UploadDate, getdate()) > " & "numDays" & ""<br>----<br><br>I get the error message saying that there is an invalid column name on that line.<br><br>Anyway, I would be very grateful if anyone could help me with any of my problems.<br><br>Thanks.<br>Taha<br><br><br><br><br><br>