Search results

  1. H

    MS Access 2007: Subtracting values from two consecutive records

    Hi, i dont think an autonumber field can be dynamcally created in a query, only in a table. We could try and generate an auto number using the date/hour but it wouldnt have afixed increment value as the hours will change from 24 to 1. but i think i do have a solution, its basicaly using a...
  2. H

    MS Access 2007: Subtracting values from two consecutive records

    Hi, In my 1st suggestion, you actually dont need to make a copy of the table. It works only from 1 table. Whats its doing is referencing the same table twice. ie in the sql satement: FROM tblReadings INNER JOIN tblReadings AS tblReadingsPrev its still reading the same table tblReadings...
  3. H

    MS Access 2007: Subtracting values from two consecutive records

    Hi, An alternative method would be to add another field to your table which would be a numeric sequence of all the readings. ie the first reading would have a readingID of 1, the second 2 etc: ReadingID Date Hour Total_MWh 1 1/1/2000 1 182.789 2 1/1/2000 2 182.996 3 1/1/2000 3 183.006 4...
  4. H

    MS Access 2007: Subtracting values from two consecutive records

    Hi, This may work, if your hour field is a numerica value and always increment by 1, then you can link the table to itself within a query. You would relate the date and the current hour with the previous hour, giving you the previous reading. for example if yr table is called tblReadings then...
  5. H

    Combining different tables

    Hi, you are right you would use a union select query, as the tables do not have the same fields, we can make the changes to view inthe query. table 1 has all the fields so you would show everything from that. you would add thr missing fields in table 2, giving you identical tables making the...
  6. H

    Retriving Specific records that contains time

    if you set the default value of IOData.IODate to =Now() this captures the date & time then in yr query you could use the criteria: WHERE IODate=Now()
  7. H

    combo box question

    from the look of yr sql you dont need to link to tblRAO as you are using RAO_ID to link and then to filter too, i'm assuming that RAO_ID is a numeric field and txtRAO is the first combo box, in this case use the following on the afterupdate event of txtRAO me.secondCombo.recordsource="SELECT...
  8. H

    totals in forms hlp plz

    try =sum([Unit Price]*[Quantity]) and put it in the report or group footer.
  9. H

    Another text date question

    convert text to date using cdate(string)
  10. H

    Check Box

    this is correct, a TRUE value is identified as -1 and False as 0, if the datatype is Yes/No in yr table then you just need to change its display format.
  11. H

    Replacing Null values in a query with Text

    try using: nz(Employee_List.Manager,"Unknown") and also you need to include the above field in yr query but dont display it.
  12. H

    qdef.Execute options??

    why dont you get yr query working with the 4 columns first. once you happy with this then just create a new query based on this where u return the 4 colums + add a new column usinf iif statement and dlookup then use that for yr listbox.
  13. H

    find duplicates in one column, match numbers in another

    try adding a new field in yr query using DMIN, somethin like: Expr1: DMin("Code","table2","Name='" & [name] & "'") replace table2 with the name of the table with the data. you have problems with Amir's as it has an apstrophe....
  14. H

    qdef.Execute options??

    i would suggest creating a 5th column in yr original query using a iif statement with a dlookup inside it: somethin like this: 5thField:iif(isnull(4thfield),null,dlookup("Portfoliocode","tbl_Portfolio","PortfolioID"=4thfield))
  15. H

    Current Date problems

    try this, create a new query, view in SQL view, then paste the following (but remember to replace Table1 with the name of table with date fields in): SELECT Table1.* FROM Table1 WHERE (((Date()) Between [date_from] And [Date_to])); View it design view later to see wat its doin. basically u...
  16. H

    How to insert a new field to an existing form

    in design view of the form, view field list (view, field list) then drag the new field from the list to yr form. Husan
  17. H

    Get all data in a column

    try somethin like this, there maybe a few syntax errors as i've wrote it on th fly... dim rst as recordset dim strValue as string strValue="" set rst=currentdb.openrecordset("tablename") rst.movefirst do until rst.eof strValue = strvaue & rst![Fieldname] & ";"...
  18. H

    Could not delete from specified Tables

    are you trying to delete a table or delete the data from a table? the primary key should not contain nulls anyway.
  19. H

    Linking to a table from another database

    instead of importing, link the table in yr 4 databases, so any changes to the backend table will be automatically reflected on yr linked tables. try this from the database file menu: file, get external data, linked tables
  20. H

    To display the result of sql statement on the screen

    i would suggest the following: create a query on the fly using the sql then open it. try puttin this code in yr command button: Dim strSQL As String Dim qdf As QueryDef 'Assign your select statement strSQL 'Delete qryTemp if it exists If DCount("Name", "MSysObjects", "Name = 'qryTemp' AND...
Back
Top Bottom