Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3872412
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:55:22+00:00 2026-05-19T21:55:22+00:00

Please see the row below: FID | IssueDate | IssueType | Status 46128 |

  • 0

Please see the row below:

FID    |     IssueDate                   |  IssueType         |    Status
46128  |     2010-12-30 00:00:00.000     |     2              |     1   

I am stucked at a very stupid thing, that a beginner can do well too. I need to update the above row. I have already asked the solution for same in various ways but did’nt achieved yet. I dont know why????.

Let me explain the above

FID is my primary key, Issue Date is my sticker issue date, issue type is my type of sticker and status is current status of sticker.

Now what i want is to check the issue date with current years 1st April. If the system date has changed from 31st March , which is the fixed last date for expiration, the row’s status will automatically get expired and status will get changed from 1 to 3.

I am using the given query , after executing it says 0 rows updated. please guide me where i am making mistake.

ALTER PROCEDURE [dbo].[spMakeStickerVoid]
(
    @FisherId BIGINT,
    @ManipulatedByUser VARCHAR(50),
    @OPParam INT OUTPUT
)
AS

BEGIN

   DECLARE @CurrentDate as DATETIME,
           @FirstAprilOfCurrentYear AS DATETIME

    SET @FirstAprilOfCurrentYear = (select dateadd(month,datediff(month,0,getdate()) ,'18990401'));
    SET @CurrentDate = GETDATE();
    --SET @OPParam =0


        IF @CurrentDate >= @FirstAprilOfCurrentYear

            BEGIN

                UPDATE tblStickerInfo
                SET    StatusId = 3

                WHERE  FisherId = 46128 AND  (IssuedDate < @FirstAprilOfCurrentYear) AND StatusId = 1

            END
        --SET @OPParam =1



END

UPDATE:

Actually, there are few conditions
**

 1. It should occur every year 1st April or onwards.

      2. All issue dates that are on or before 31st March of that year will get 
expires, status    =3

      3. So i put a check if current date is 1st april or greater than that. 
because there might be a condition if the system was switched off on 1st april 
and started working on 4 th April. So even in this case the stickers prior to 
1st april will have to expire. 

      4. For making my query clear, just take an example of Insurance policy ,
 which is only valid for a year. Like if i have registered it on 28th Jan2011, 
then it will automatically get expired on next year 27th Jan 2012 midnight.
 But here in my case date is fixed to 31st March midnight every year.

      5. Columns names and parameters are not an issue here, i had 
placed somewhat diff here consider FID = FisherId

      6. Need a query that will automatically populate the @FirstAprilOfEveryYear 
with first april of that year, so that it will be carried out automatically.

**
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:55:23+00:00Added an answer on May 19, 2026 at 9:55 pm

    @FirstAprilOfCurrentYear is the first of april of 2010 which means that (IssuedDate < @FirstAprilOfCurrentYear) is not true.

    This might do what you want

    declare @FirstOfAprilCurrentYear datetime
    set @FirstOfAprilCurrentYear = dateadd(year,datediff(year,0,getdate()) ,'1900-04-01') 
    
    if @FirstOfAprilCurrentYear >= getdate()
    begin
        -- Current date is After 31st March current year
        update tblstickerinfo
        set statusid = 3
        where IssuedDate < @FirstOfAprilCurrentYear
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please see the below code: I am have a table row defined using asp.net
Please see below code: thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin(); end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
Please see below: I tried using Absolute layout, but that's deprecated. I appreciate your
Please see the code snippet below : #include <iostream> using namespace std; int main()
Please see my pseudo-code below. The code comments should explain my problem. I'm new
Please see the data tables and query below .. Items Id, Name 1, Item
I'm trying out very simple search popup on the JqGrid. Please see the code
Would someone please help me. I have a stored procedure (see below) for data
I have a table in in which every row contains a form. see below
Please see my code below : <div class=grid_6 box a col1 row1 style=left: 231px;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.