DataBase - Numerical query criteria and quotation marks
Asked By PD
20-Nov-09 04:50 PM
I have a query that uses a criteria of >"269.9". I realized it was not
working because the format of the field being queried was text. I
successfully altered the format of the source field to double. Access will
not allow me to remove the quotation marks from around the "269.9" criteria.
It puts them back as soon as I tab off the field. If I create a new query it
works, but why will not it let me modify the existing one?
Thanks,
--
PRD
KARL DEWEY replied to PD
In query design view try deleting the field, save, and then put it back.
--
Build a little, test a little.
CPU 01 P1 DEV 52 01 P1 DEV 52 02 P2 DEV 40 03 P1 PRD 20 07 P1 PRD 10 03 P2 PRD 33 02 P3 PRD 75 06 P3 PRD 10 05 P3 QA 91 07 P7 DEV 15 I need to show on columns sumarized PROG CPU-DEV CPU-QA CPU-PRD P1 104 0 30 P2 40 0 33 P3 0 91 85 P7 15 0 WHEN ENV = 'QA' THEN sum(CPU) ELSE 0 END) AS CPU-QA, (CASE WHEN ENV = 'PRD' THEN sum(CPU) ELSE 0 END) AS CPU-PRD from PERFDATA group by PROG, ENV but got PROG CPU-DEV CPU-QA CPU-PRD
without the group by give me these results : CMP CNT CODE GROUP ENDQTY ROWPARTITIONED 001 PRD 100 AAA 20 1 001 PRD 100 BBB 50 2 001 PRD 100 CCC 100 3 - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- CMP CNT CODE GROUP ENDQTY ROWPARTITIONED 001 PRD 100 AAA 20 1 001 PRD 110 BBB 50 1 001 PRD 120 CCC 100 1 In the first case what I want is this one CMP CNT CLM1 CLM2 CLM3 001 PRD 20 30 50 in the second case what I want is CMP CNT CLM1 CLM2 CLM3 001 PRD 20 50 100 The columns(CLMx) must be calculated in the following way : If the
Date DataBase I have a date field [fstrlsedt] and a number field [prd]. The number field is actually refering to number of months. How to put an expression to find a new date by adding [fstrlsedt] with the number of months [prd] Access Discussions Date (1) Dec (1) DateAdd function (1) Database (1) Execute (1) Expression (1 Prd (1) Hmm. . . the DateAdd function sounds awfully promising!!! Create an unbound control and use something like DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd")) Awfully descriptive control names. . . I hope you never give someone your database to work on m expecting is to get new date as follow Assume [fstrlsedt] = "01-01-2010" and [prd] = 12 my new date will be "01-01-2011" That's exactly what Pieter's happened when you tried it? When i put DateAdd("m", me.Controls("fstrlsedt"), me.controls("prd")) in my query error of "Undefined function "me.controls" in expression Then i changed to DateAdd("m", [fstrlsedt], [prd]) but the result is not correct eg the [fstrlsedt] = 30 / 04 / 2010 and prd] = 60 and the was new date = 28 / 04 / 5258 As George pointed out. . . clearly, you
days between replacements of like item numbers for each serial number. Thanks a bunch PD - - PRD Access Queries Discussions NextDate.ItemNumber (1) NextDate.Serial (1) RepInterval (1) ElapsedDays (1) ItemNumber (1 newsgroup only. Thanks John, I am not familiar with subqueries, I will learn and try. - - PRD Thanks Dale, This worked great, but I can have a growing number of replacements of a replacement in my original question. Is there a modification you can suggest? Thanks again, - - PRD John, I have not been able to figure out how to insert the statement as a sub query, any suggestions? Thanks, - - PRD Are you asking how to limit the results of the second query to give you to newsgroup only. Dale, I want to capture all replacements of each item number. Thanks, - - PRD The query string I posted was an entire query. The subquery would have been just ElapsedDays FROM [Ripper_development] as TA Any ideas? I have tried numerous variations with no luck. - - PRD One you surrounded work_dt with SQUARE brackets instead of parentheses. Also since you fields have