Search results

  1. E

    IIF not returning data - if "false", should return all results

    Or we can look at it like this. We know that when the check box is checked, a record whose field value is equal to the value in the combo box will be returned because the expression [FieldName]=[Forms]![form-name]![combobox-name] for this record will evaluate to True. Hence when the check box...
  2. E

    IIF not returning data - if "false", should return all results

    Put the criteria in a new column in the query grid like this, using the correct field name:- ----------------------------------- Field: IIf([Forms]![form-name]![checkbox-name]=True, [FieldName]=[Forms]![form-name]![combobox-name], True) Show: uncheck Criteria: True...
  3. E

    DOB to Age

    Age: DateDiff("yyyy",[DOB],Date()) +(Format(Date(),"mmdd")<Format([DOB],"mmdd")) In query Design View, put it in the Field: row, not the Criteria: row. ^
  4. E

    Want to see only those clients who has email id

    You can put the criteria in a new column in the query grid like this, using the correct form name and check box name:- ------------------------------------------------ Field: IIf([Forms]![formName]![checkBoxName]=True, [ID] Is Not Null, True) Show: uncheck Criteria: True...
  5. E

    Error adding hours

    SELECT tblTrip.PaySlipReference, Sum(tblTrip.NDays) AS TotNDays, Int(Sum(tblTrip.FlyingTime)*24)&"."& Format (Sum(tblTrip.FlyingTime),"nn") AS TotFlyingTime, Int(Sum(tblTrip.DutyTime))&"."& Format(Sum(tblTrip.FlyingTime),"nn") AS TotDutyTime, Int(Sum(tblTrip.TAFB))&"."&...
  6. E

    Want to see only those clients who has email id

    In a query, put Is Not Null in the criteria for the ID field. ^
  7. E

    Change Query Based On Form Fields

    See Jon K's Basic Criteria Format in the Sample Database forum: http://www.access-programmers.co.uk/forums/showthread.php?t=103312 ^
  8. E

    query with dates, ...help pls!

    What you need is a series of two queries. qryBooked:- SELECT [Car_ID_fk] FROM [Booking] WHERE [Book_End]>=[Enter Start Date] And [Book_Start]<=[Enter End Date]; qryAvailable:- SELECT [Cars].[Car_ID], [Cars].[Car_Name] FROM [Cars] LEFT JOIN [qryBooked] ON...
  9. E

    Why need to order MS Access?

    It depends on the version of Office that you have. Standard versions of Office do not include Access. ^
  10. E

    IIf Function - False condition problem

    Put the criteria in a new column in the query grid like the following, using the correct field name:- ----------------------------------- Field: IIf([Forms]![frmReports]![cboServArea]>0,[FieldName]=1,[FieldName]>0) Show: uncheck Criteria: True ---------------------------------- which is...
  11. E

    Criteria For Parameter

    Put the criteria in a new column in the query grid like this (using the correct date field name):- ---------------------------------------- Field: [DateFieldName]=[Enter a date] Or [Enter a date] Is Null Show: uncheck Criteria: True ---------------------------------------- See Jon K's Basic...
  12. E

    parse a string with years month and days....

    Try this:- Val(Mid([TextString], InStr([TextString]," month")-2)) ^
  13. E

    Search Form Based On Query

    Try Jon's basic criteria format in this thread: http://www.access-programmers.co.uk/forums/showthread.php?t=103312 ^
  14. E

    Trouble with "Like" parameter.

    Brian is right. "Like" is not going to give you what you want. Use the = operator instead. ------------------------------------- Field: [FieldName]=[parameter:] or [parameter:] Is Null Show: uncheck Criteria: True ------------------------------------- ^
  15. E

    Helpp!!: Count & Group By with in a Query

    Count(*) returns the total number of records within a group. Count([aFieldName]) returns the number of records within a group, excluding any null values in the named field. Since there is not likely to be any null values in the complaint field of a complaint table, I just used the more...
  16. E

    Helpp!!: Count & Group By with in a Query

    Try this query;- SELECT Cities.P_Names, Complaints.ComplaintShort, Count(*) As Num FROM Complaints INNER JOIN Cities ON Complaints.prec_id=Cities.P_prec Group By Cities.P_Names, Complaints.ComplaintShort Having Cities.P_Names=Forms!Form1!comType ^
  17. E

    Parameter query asking for parameter more than once!

    You can use two text boxes (e.g. txtStartDate and txtEndDate) on a form for the user to input two dates and let the user run the query from a command button on the form. In the query, you can reference the text boxes like this ("Between ... And ..." is more efficient than >= and <=):- And...
  18. E

    Promting user for a value and then using that to search for records

    In query Design View, put the same prompt for each of the three fields, but put it in three separate criteria rows (see the attached image.) Three fields for the years. Your data are stored in a spreadsheet-like table. That is, they are not normalized. Unlike Excel, Access is a relational...
  19. E

    Help Coding Parameters for Queries

    Yes, it works. But see Jon's remarks in his Note (1): "It works. However, when the query is saved, Access splits each of such criteria into two columns and two criteria rows, making it very difficult for us to subsequently edit the criteria or add other criteria." For three fields required by...
  20. E

    Help Coding Parameters for Queries

    No. If you read the opening question, you will see that the example allows the user to leave the parameters blank. Using text boxes on a form for the user to input parameters like Jon's example is more user-friendly. If you do not want to use a form, you can set the criteria for each field...
Back
Top Bottom