Search results

  1. G

    Specialixed Query

    Though I'm not the original poster, I posted a related link about inline expression. . But what you wrote sounded you did in your first post:-You don't need two queries to do this; you can do it with one query (query with a subquery)
  2. G

    Specialixed Query

    I have read where people complained about Access changing the ( ) brackets to [ ] when a query with an inline expression was saved. ( http://www.access-programmers.co.uk/forums/showthread.php?t=61934&highlight=%5BSelect ) Since both a single query with a subquery (as you offered in your first...
  3. G

    building a query based on purchases_total and purchases_details

    Pat, Can a report with a subreport, as what you suggested, produce what Ethan wanted, that is, a two-column report showing the money spent on a monthly basis?
  4. G

    Calculate hours

    If the two fields are date/time fields, Jon K's sample in this thread may help: http://www.access-programmers.co.uk/forums/showthread.php?t=62733
  5. G

    recieving error when running query

    Open the crosstab query in Design View. Choose menu Query, Parameters... In the dialog box that pops up, type [Forms]![frm_LME]![DateStart] in the Parameter column, and select the correct data type in the Data Type column. Repeat for the other parameter [Forms]![frm_LME]![DateEnd]
  6. G

    Problem editing queries

    Instead of using a one-query approach, I think you can use a two-query approach. Save the nested SQL statement as a separate query. Then link to this query in your original query.
  7. G

    Limit query to 1 record via VB code

    If PatientID is a text field, try this:- SQLStatement:="SELECT * FROM [QryAdenCard] WHERE [PatientID] ='" & [Forms]![FrmNucCard]![Text151] & "';" If PatientID is a numeric field, try this:- SQLStatement:="SELECT * FROM [QryAdenCard] WHERE [PatientID] =" & [Forms]![FrmNucCard]![Text151] & ";"
  8. G

    Months AND Current Date

    This should also work, though it lacks the flexibility of Jon's function. SELECT * FROM [yourTableName] WHERE format(DateAdd("d",-26,[DateOut]),"yyyymm")=format(DateAdd("d",-26,Date()),"yyyymm");
  9. G

    query IIf problem

    In the calculated field, the numbers become text! If the results are not used in further calculations, then it is quite OK.  
  10. G

    Crosstab Queries

    You need to declare the data type of the parameter in the first query. Open the first query in Design View. Choose menu Query, Parameters... Type the combobox reference in the Parameter column i.e. [Forms]![formName]![comboBoxName] In the next column, select the correct Data Type.
  11. G

    Criteria for Yes/No data type

    Criteria expression: [Enter -1 for true, 0 for false]
  12. G

    query IIf problem

    Do you mean we can put 100   <- - a number, not text. 200   <- - a number, not text. wrong <- - text. in one column (that is, in the same field) in the query results?
  13. G

    query IIf problem

    You can't put the word "Wrong" in a numeric field.
  14. G

    Using a parameter to return all records if it's left null

    Thank you very much, Jon K To verify what you said, I downloaded your database and created a query with this expression:- Expr1: [Cutting Status] Like [Forms]![frmViewSearch]![Srch_CuttingStatus] Is Null For the two records that contained Null values in the [Cutting Status] field, Expr1 always...
  15. G

    Using a parameter to return all records if it's left null

    Jon K- I have been using Martin Green's method. It works when the field doesn't contain null values. Why doesn't it work when the field contains null? Thanks. Gib
  16. G

    IIf condition, form date, all dates

    Jon, Thanks for the example and your clear explanation. I have one more question if you don't mind.  How do I change the criteria to return also the null dates when the check box ChkPostDate is not checked? In the present IIF criteria, null dates are excluded. Thanks again. Gib
  17. G

    IIf condition, form date, all dates

    Jon, I wasn't able to replicate the database and try the "Like Operator". Can you post an example? I was also wondering ... if the = sign was invisible, how would we know there was an = sign there? Best regards. Gib
  18. G

    IIf condition, form date, all dates

    The above IIF criteria in the first post seems quite OK. Does anyone know why it won't work?
  19. G

    Months not a month

    Try this setting in a column in the query grid. Field: IIf(Day(Date())<28 And Month(Date())=1,[DeliveryDate] Between DateSerial(Year(Date())-1,12,27) And DateSerial(Year(Date()),1,26),IIf(Day(Date())<28,[DeliveryDate] Between DateSerial(Year(Date()),Month(Date())-1,27) And...
  20. G

    Months not a month

    Between DateSerial(Year(Date()),Month(Date())-1,27) And DateSerial(Year(Date()),Month(Date()),26)
Top Bottom