Click here to Skip to main content
15,878,953 members
Home / Discussions / Database
   

Database

 
QuestionHow to get the Output based on Next Date if exists in the Table Pin
Robymon9-Jun-14 22:28
Robymon9-Jun-14 22:28 
SuggestionRe: How to get the Output based on Next Date if exists in the Table Pin
Richard MacCutchan9-Jun-14 22:47
mveRichard MacCutchan9-Jun-14 22:47 
AnswerRe: How to get the Output based on Next Date if exists in the Table Pin
Mycroft Holmes9-Jun-14 22:51
professionalMycroft Holmes9-Jun-14 22:51 
GeneralRe: How to get the Output based on Next Date if exists in the Table Pin
Robymon9-Jun-14 22:56
Robymon9-Jun-14 22:56 
GeneralRe: How to get the Output based on Next Date if exists in the Table Pin
Mycroft Holmes9-Jun-14 23:01
professionalMycroft Holmes9-Jun-14 23:01 
AnswerRe: How to get the Output based on Next Date if exists in the Table Pin
Tim Carmichael10-Jun-14 2:49
Tim Carmichael10-Jun-14 2:49 
AnswerRe: How to get the Output based on Next Date if exists in the Table Pin
Bernhard Hiller10-Jun-14 20:56
Bernhard Hiller10-Jun-14 20:56 
QuestionManually increment a column value in SQL Server database through query when date < currentdate Pin
hilbiazhar9-Jun-14 20:08
hilbiazhar9-Jun-14 20:08 
Hi.

I have just starting learning database so this would be a rather basic question but I can't figure out how to achieve this.

I have a table in database in which there is a column named Date where I store a date( Just the date in the format dd/mm/yy) and there is another column named IntegerColumn in which initially I am storing the integer value 0.

Question is

How to increment the interger value 0 by 1 in IntegerColumn when the date in Date is less then the current date.

Note that the data type for the column storing the date is nvarchar(50) and I am keeping in check the date format i.e dd/mm/yy through code behind in my asp.net application. And additionally I am using SQL Job Scheduling for the query to recur each time SQL Server finds the date less then the current date.

I have done this much...
SQL
DECLARE @IncrementValue int
SET @IncrementValue = 1
UPDATE tableA SET IntegerColumn = IntegerColumn + @IncrementValue
WHERE Date < GETDATE()

AnswerRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
Chris Quinn9-Jun-14 20:53
Chris Quinn9-Jun-14 20:53 
GeneralRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
hilbiazhar9-Jun-14 21:30
hilbiazhar9-Jun-14 21:30 
AnswerRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
Chris Quinn9-Jun-14 21:04
Chris Quinn9-Jun-14 21:04 
AnswerRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
Mycroft Holmes9-Jun-14 22:57
professionalMycroft Holmes9-Jun-14 22:57 
GeneralRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
hilbiazhar10-Jun-14 3:00
hilbiazhar10-Jun-14 3:00 
GeneralRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
Chris Quinn10-Jun-14 4:02
Chris Quinn10-Jun-14 4:02 
QuestionRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
Eddy Vluggen10-Jun-14 5:28
professionalEddy Vluggen10-Jun-14 5:28 
AnswerRe: Manually increment a column value in SQL Server database through query when date < currentdate Pin
hilbiazhar10-Jun-14 5:49
hilbiazhar10-Jun-14 5:49 
QuestionRegarding case control statement in mysql Pin
aghori9-Jun-14 3:15
aghori9-Jun-14 3:15 
AnswerRe: Regarding case control statement in mysql Pin
Wayne Gaylard9-Jun-14 3:22
professionalWayne Gaylard9-Jun-14 3:22 
GeneralRe: Regarding case control statement in mysql Pin
aghori9-Jun-14 3:34
aghori9-Jun-14 3:34 
AnswerRe: Regarding case control statement in mysql Pin
Jörgen Andersson9-Jun-14 3:25
professionalJörgen Andersson9-Jun-14 3:25 
GeneralRe: Regarding case control statement in mysql Pin
aghori9-Jun-14 3:37
aghori9-Jun-14 3:37 
Questiondatatype mapping Pin
Gilbert Consellado8-Jun-14 22:14
professionalGilbert Consellado8-Jun-14 22:14 
AnswerRe: datatype mapping Pin
Richard MacCutchan8-Jun-14 23:24
mveRichard MacCutchan8-Jun-14 23:24 
GeneralRe: datatype mapping Pin
Gilbert Consellado8-Jun-14 23:47
professionalGilbert Consellado8-Jun-14 23:47 
GeneralRe: datatype mapping Pin
Richard MacCutchan8-Jun-14 23:56
mveRichard MacCutchan8-Jun-14 23:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.