cjbrown815
IS-IT--Management
Hello, I have this statement that is working great. But, the parameter for pH does not have a Print Flag=1 (SAMPLEPARAM.PRINT_FLAG=1))
, so I have to add it in somehow. Like SAMPLEPARAM.PA_NAME like %pH%
When I do an OR at the end of this it blows away most of the other criteria. I need exactly what this statement is pulling, but I need pH brought in as well. Thanks
STATEMENT
SELECT SAMPLE.SAMPLE_ID, SAMPLE.SAMPLE_STATUS, SAMPLE.SUBMITTER, SAMPLE.SAMPLE_TYPE, SAMPLE.TEXT3, SAMPLE.TEXT5,
SAMPLE.DATE3, SAMPLE.REMARKS, SAMPLE.LOT, SAMPLE.PRODUCT_LOT, SAMPLETYPE.ST_TYP, SAMPLETYPE.ST_ID, SAMPLETYPE.ST_NAME,
SAMPLETYPE.ST_DESC, SAMPLEPARAM.PA_NAME, SAMPLEPARAM.TRESULT, SAMPLEPARAM.NRESULT, SAMPLEPARAM.SRESULT, SAMPLEPARAM.ORESULT,
SAMPLEPARAM.SAMPLEPARAM_ID
FROM LIMSProd.dbo.SAMPLE SAMPLE, LIMSProd.dbo.SAMPLEPARAM SAMPLEPARAM, LIMSProd.dbo.SAMPLETYPE SAMPLETYPE
WHERE SAMPLE.SAMPLE_ID = SAMPLEPARAM.SAMPLE_ID AND SAMPLEPARAM.ST_N = SAMPLETYPE.ST_N AND
SAMPLEPARAM.ST_VERS = SAMPLETYPE.ST_VERS AND
((SAMPLE.SAMPLE_TYPE Like 'WKLY_%') AND (SAMPLE.DATE3>=DateAdd(yy,-3,GetDate())) AND (SAMPLEPARAM.PRINT_FLAG=1))
ORDER BY SAMPLE.DATE3, SAMPLE.SAMPLE_TYPE
-CJ
SQL2005// CRXIr2// XP Pro
"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
, so I have to add it in somehow. Like SAMPLEPARAM.PA_NAME like %pH%
When I do an OR at the end of this it blows away most of the other criteria. I need exactly what this statement is pulling, but I need pH brought in as well. Thanks
STATEMENT
SELECT SAMPLE.SAMPLE_ID, SAMPLE.SAMPLE_STATUS, SAMPLE.SUBMITTER, SAMPLE.SAMPLE_TYPE, SAMPLE.TEXT3, SAMPLE.TEXT5,
SAMPLE.DATE3, SAMPLE.REMARKS, SAMPLE.LOT, SAMPLE.PRODUCT_LOT, SAMPLETYPE.ST_TYP, SAMPLETYPE.ST_ID, SAMPLETYPE.ST_NAME,
SAMPLETYPE.ST_DESC, SAMPLEPARAM.PA_NAME, SAMPLEPARAM.TRESULT, SAMPLEPARAM.NRESULT, SAMPLEPARAM.SRESULT, SAMPLEPARAM.ORESULT,
SAMPLEPARAM.SAMPLEPARAM_ID
FROM LIMSProd.dbo.SAMPLE SAMPLE, LIMSProd.dbo.SAMPLEPARAM SAMPLEPARAM, LIMSProd.dbo.SAMPLETYPE SAMPLETYPE
WHERE SAMPLE.SAMPLE_ID = SAMPLEPARAM.SAMPLE_ID AND SAMPLEPARAM.ST_N = SAMPLETYPE.ST_N AND
SAMPLEPARAM.ST_VERS = SAMPLETYPE.ST_VERS AND
((SAMPLE.SAMPLE_TYPE Like 'WKLY_%') AND (SAMPLE.DATE3>=DateAdd(yy,-3,GetDate())) AND (SAMPLEPARAM.PRINT_FLAG=1))
ORDER BY SAMPLE.DATE3, SAMPLE.SAMPLE_TYPE
-CJ
SQL2005// CRXIr2// XP Pro
"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931