Search results

  1. C

    Max date in sql query issue

    solved it now, issue with selection criteria Thanks for all your input :)
  2. C

    Max date in sql query issue

    Yes have tried that, the initial query as the bracketted select (correct number of results) then wrapping it in the select * statement yet it still doesnt produce correct resuilts.. select * from Table1, (select ID,max(DDATE) as maxdate from Table1 where ID in 'AA1', 'AA2', 'AA3', 'AA4'...
  3. C

    Max date in sql query issue

    Well i have just tried playing with: SELECT * FROM Table1, (SELECT max(DDATE) as maxdate, ID FROM Table1 GROUP BY ID) maxresults WHERE Table1.ID= maxresults.ID AND Table1.DDATE= maxresults.maxdate AND Table1.ID in ('AA1', 'AA2', 'AA3', 'AA4', 'AD4', 'AD6', 'AD8', 'AE9'); Which appears to...
  4. C

    Max date in sql query issue

    Thats correct, so where i have 3 occurances, i want just 1 which holds the max date of the 3 aswell as all other data in the record.
  5. C

    Max date in sql query issue

    Hi all, I know how to get the max date per ID with: select max(DDATE) from Table1 where ID in ('AA1', 'AA2', 'AA3', 'AA4') group by ID However, how can i retrieve all columns within the table based only on the max date? I know, by including all the tables column headings, it will...
  6. C

    MAX()+1 within INSERT statement

    Hi all, I have a table that i wish to update but am having trouble due to my value ItemNum. I need this to be the next highest (max+1) number in the column ItemNum (for a script, this is not an autonumber column). In essence what im trying to contsruct is: insert into TABLE1 (New1, Status...
  7. C

    Issue finding gap between two dates (text strings) in SQL

    nevermind, all done! thanks for the assist everyone
  8. C

    Issue finding gap between two dates (text strings) in SQL

    Right, down to a bugger now: My query contains: Expr1: CDate(Left([OldDate],4) & "/" & Mid([OldDate],5,2) & "/" & Right([OldDate],2)) New: CDate("27/05/2009") Newest: Abs(DateDiff("d",[New],[Expr1])\365.25) & "Years," & Abs(DateDiff("m",[New],[Expr1]) Mod 12) & "Months," &...
  9. C

    Issue finding gap between two dates (text strings) in SQL

    Ive solved that part now using Expr1: CDate(Left([OldDate],4) & "/" & Mid([OldDate],5,2) & "/" & Right([OldDate],2)) Now to sort out DateDiff to the approximate time and not year ^^;
  10. C

    Issue finding gap between two dates (text strings) in SQL

    Appreciate the input but i think a point has been missed. At this time the date is a STRING, in the format of 19900101. I need to convert that into a date format that can be read by datedif (as CDate wont convert it in its current state) hence need to know how to format 19900101 to become...
  11. C

    Issue finding gap between two dates (text strings) in SQL

    Thanks for the notes, to be honest i hadn't thought of the months / days ^^; How can i format the string 19900101 into 1990/01/01 as a table value in a query? I plan on doing this then running the datediff. Have been browsing but cannot find the specific expression.
  12. C

    Issue finding gap between two dates (text strings) in SQL

    Hi all, Having a lil trouble with a query. Im trying to returns results where the difference between OldDate and "2009-05-27" is less than or equal to 20 years. The issue i have is that OldDate is a text string (import from csv), and i dont believe CDate works in SQL. SELECT * FROM INFO...
  13. C

    VSFlexArray Control issue

    Hi all, Seems very hard to find any information on this. I currently have a populated flexarray control on a form but im unable to retrieve the values to save as an output, preferably a recordset to write the contents to a text file. Unlike with VSFlexgrid 3.0, you do not have access to the...
  14. C

    INSERT into last row of a table

    well with that, is there a way to edit the table once exported to CSV to specifically ammend the first and last row?
  15. C

    INSERT into last row of a table

    Yes but i need to be sure its in the last free row of the currently populated table, hence specifying it with the recordcount.
  16. C

    INSERT into last row of a table

    Hi, Hitting an issue with an Access table, im trying to insert a value into the last line of a table as a customised trailer but can't seem to enter it into the very last row. Im currently trying the criteria below but how do i link the recordset, having found the last 'occupied' row, to...
  17. C

    Tab control within tab control?

    Hi, Having some trouble with a Tab control, whenever i create two tab controls, one within the other, it shows that second control on each tabbed page where as i only want it contained on the tabbed page it was created within. Any tips would be appreciated.
  18. C

    view recordset gathered data (odbc) without a table?

    My apologies, ive been updating this post a fair few times now lol. Finally got it all working using the VSFlexiGrid control. Code beloew for your reference (doesn't use the recordset data, just uses number of rows and outputs the text values "Paul" and "555-1212" for the number of rows in...
  19. C

    view recordset gathered data (odbc) without a table?

    Sorry for sounding amateur, how do you bind it to a form?
Back
Top Bottom