Home : LCSND
Q14538 - INFO: LCSND

LCSND returns the next due date for Lab Cal Sample for the specified Sample definitions.

SYNTAX:

LCSND(StartDate,DateFormat,SampleDefId1,..SampleDefId99)

or

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.

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). 

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 5/24/2019 4:34 PM.
Last Modified on 5/24/2019 4:34 PM.
Last Modified by Scott Dorner.
Article has been viewed 1847 times.
Rated 7 out of 10 based on 2 votes.
Print Article
Email Article