Calculated Columns
How would I add a column that would supply the number of days for the following? I originally had three separate stored procedures that returned the rows. I need to use just one for my chart. 1....
View ArticleCalculate "Expiration Date" Based on Date and Looked Up Value in MS SQL
I am creating an employee training tracking database. I have all of the training classes in a table along with the number of days said training is valid. (e.g. -[TrainingID],[TrainingName],...
View ArticleYTD Calculation
Hi I am trying to add a column that has YTD total calculation based on another column, below is my stored procedure that gets me my data... USE [test] GO /****** Object: StoredProcedure [dbo].[test]...
View Articleusing sql server string functions to extract the values
I have a column transactionID which have data like '3368/00392224/000/00' in this format. Now I have to extract data from this column in to four columns like Column name Data A 3368 B 00392224 C 000 D...
View ArticleSSRS Calculate diffence between report column values?
I have a reasonably simple report which shows school results for three terms, Christmas, Easter and Summer. I'm trying to calculate the difference in results between terms (per student), but I'm...
View ArticleCalculate week from a date
I have to calculate a week number depending on a date for a customer. their fiscal calendar is different than the regular calendar , so I can't use the usual date to week number conversion. so in the...
View ArticleHow do i write a computed column from two tables with separate dates?
In SQL Server I create a separate/new table of many indicator values every trading day. I want to know the daily net change between them. In other words, a computed column where the net change in the...
View ArticleI want to create a table with currentdate as DateCreated column in it. So...
I want to create a table with currentdate as DateCreated column in it. So when the data comes in everyday, it should show the current date for that item.. (want to start new Inventory table)
View ArticleUsing a calculated column in a SQL Select statement
I am trying to write a query. Column A comes from database, column B is either 1 or -1 and it is result of a CASE statement that looks into the same table. Now, my column C needs to refer to column B...
View ArticleCalculate Date Based on Start and End Date plus Existence of Specific...
Hi there,I am trying to create a list of dates which correlate to a specific weekday (Wednesdays in this case), where I only have the start date, end date, and what can be described as some sort of...
View ArticleIs it possible to compute a value in a view (Part_Final) and also use that...
This is what I'm attempting to do... CREATE OR ALTER VIEW Parts_View AS SELECT [Part] , [Part_Corrected] , CASE WHEN Part_Corrected IS NOT NULL THEN Part_Corrected ELSE Part END AS Part_Final , (SELECT...
View Article