LCSND returns the next due date for Lab Cal Sample for the specified Sample definitions.
LCSND(StartDate, DateFormat, Where Clause)
StartDate: The date to start searching from. Can be a quoted date, cell reference to a date cell, or a date formula. NOTE: If blank (i.e. "") current date is used.
DateFormat: The format that the date will be outputted. See here for format explanation.
SampleDefId1,..SampleDefId99: A comma separated list of SampleDefIds that sets which samples to analyze. The SampleDefIds (LC_SAMPLEDEF.ID) is shown on the statusbar in the lower right in Sample Setup.
Where Clause: Instead of providing a list of SampleDefIds, you can use an SQL Where clause against the SAMPLEDEF,Location table to get the list of variables. I.E. "NAME LIKE = 'TCR%'" wound return all samples defs that start with the text 'TCR'. See Examples.
=LCSND("","Short Date",30) returns 6/11/2019.
Find the next date of the Quarterly Metals sample, start looking on the current date 5/24/2019. The sample Effluent Metals is scheduled for 6/11/2019. The sample has Copper, Lead, Cadmium, and Chromium. LC_SAMPLEDEF.ID is 30 for this sample.
=LCSND("","Short Date","LVL2_ID=34 AND NAME LIKE '%L&C'") returns 1/1/2022.
We want to find the next Lead and Copper sample that is scheduled at any distribution site. We have setup our schedule as once every 3 years on Jan 1st starting in Jan 2019. The current date is 5/24/2019, therefore the next samples are due on Jan 1st 2022 (note this is off the Lab Cal Calendar which only goes 9 months into the future). We have 20 different sites/locations setup, each with it's own pair of Lead and Copper variables. Use the Analyte Code for lead (1030) which we will use as the trigger var to detect the sample. Also, we only want variables that have Lead and Copper as it's Parent (i.e. LVL2_ID of 34).