Recent content by just.a.guy

  1. J

    Query Problem Between Two Times

    thinking it over since hour returns 0 - 23, then you don't need to add include "+1" or "+24"
  2. J

    Query Problem Between Two Times

    by the way, if you use the "hour" command you have to change the " + 1" to " + 24"
  3. J

    Query Problem Between Two Times

    Well I assume for TACO MAC, that open time is something like 8:00 AM and the close time is 2:00 AM. If the logic works correctly, then the test Iif( close <= open gives 8:00 AM <= 2:00 AM This is false therefore the second "false" IIF is tested next iif( open <= form.time and close +...
  4. J

    Self Join Sum-Group

    I assume you want the "where" conditions ItemClass to still be true. The simplest way for me to do it is to make a query out of this complex query. Call it "bom_7_levels". I would modify the query slightly and add "AS" clauses for each field to give a unique column name (rather than a...
  5. J

    Query Problem Between Two Times

    DCrake is correct - you need to compare the start and end time. You can use nested IIF statement Status: IIF([OpenTime] <= [CloseTime] ,IIf([OpenTime]<=[Forms]![frmMain]![TimeSelection] And [CloseTime]>[Forms]![frmMain]![TimeSelection],"Open","Closed")...
  6. J

    Null criteria in Query

    I don't know. You may be looking for something like this: SELECT .............. FROM..... WHERE RANCH like [Enter Ranch #] AND AREA like trim([Enter Area]) + "*" ---------------------------------- This should result in two prompts a. "Enter Ranch #" b. "Enter Area". If you enter an "AREA"...
  7. J

    Subtraction of two rows in the same column

    Chi, There may be one problem with GalaxiomAtHome's solution. you may end up with too many rows. Here is a sample of the SQL he might have been proposing SELECT a.month_no - b.month_no as month_diff , a.total_of_sales - b.total_sales as sales_diff , a.total_prod - b.total_prod as...
  8. J

    Designing Education based database

    Just a brief comment. It sounds like the badge to requirements is a "many to many" relationship. Do you want each badge to have many requirements? And do you want one requirement to applicable to more than one badge? If this is the case, then you need to use a relationship table. This table...
  9. J

    Splitting one table in to multiple tables- how to move the data afterwards

    Mike's method uses less SQL, and is probably quicker. Here is an approach that I would use. First, I assume that you will replace the data that you move out of the "big table" with a "key" from the target table (a foreign key). 1. Create the new table. 2. create a new query (I only use the...
  10. J

    Fussy Query

    If this is access (.mdb), have you tried compressing the database?
  11. J

    row limit in SQL Query Design

    I have encounter a situation where my query was too complicated (too big?) to be saved in ACCESS. My solution was to break the query into multiple query members. The main issue to watch for is the use of "alias" labels for table names. It seems (I am guessing) that "labels" are global in...
  12. J

    Adding up grouped response values

    This might work as a Quick and Dirty solution. Don't know if ACCESS will complain about the lack of a "group by" class. Create a new query. Then switch to VIEW/ "SQL". paste in the code. Hope it works. ========================================= select sum(iif( r.q# = 1 or r.q# = 4 or...
  13. J

    Help, query question about "finding a string"

    Here is another option where instr(","+Table.numberList+',", ',51,') > 0 I add a beginning comma and an ending comma and then search for comma 51 comma. This assumes there are no blanks in the list. If you have blanks use instr( ","+replace(numberList," "', ""')+",", ",51,") > 0
  14. J

    Need help with Select Distinct

    Not sure what you want do display as a result of the select. Here I just display the serial number. I use a JOIN of the table with itself. The LEFT table is a query of distinct serial numbers. The RIGHT table is a list of serial number that have data in FIELD3. I assumed FIELD3 is a text...
Back
Top Bottom