Skip to content

Instantly share code, notes, and snippets.

using OvfgNx.Data;
using OvfgNx.Models;
using System;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
namespace OvfgNx.Validators
{
/// <summary>
/// This vaidator checks that the job contains the serial that the user has entered
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
DECLARE @iArea INT
DECLARE @sTagName NVARCHAR(50)
SET @StartDate = '19700101 0:00'
SET @EndDate = GETDATE()
/* Get TagName from ID, Historian requires TagName for lookups */
SELECT @sTagName = (SELECT tr.TagName
FROM TagRef tr
@mrezekiel
mrezekiel / query.sql
Last active February 4, 2020 01:31
For Praveen
-- Citect Historian
DECLARE @iArea INT;
-- SET @iArea = 2797;
SET @iArea = 86;
SELECT DISTINCT left([SampleValue],4) as SampleValue
FROM [dbo].[StringSamples]
WHERE [TagID] = @iArea
AND [QualityID] = 192
AND [SampleValue] IS NOT NULL
AND [SampleValue] <> ''
@mrezekiel
mrezekiel / Contacts.php
Last active December 13, 2015 23:19
Gist for DoctrineORMModule Issue #181
<?php
namespace Application\Entity;
use Application\Factory\ChangeTracker;
use Doctrine\ORM\Mapping as ORM;
/**
* Contacts
*
* @ORM\Table(name="contacts")