Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my table name is receipts

the table has the following columns
acno,name,dueamt,no.of.days,duedate.

i need to fill the due date using auto generate date the date is started from 02/02/2018 to after 100 days.
please help me.............

What I have tried:

i have a idea to create auto generate id,but i don't know how to create auto increment date in c#.
Posted
Updated 6-Feb-18 23:42pm

1 solution

If the due date is always 100 days from invoice date (which would be unusual in practice, different customers would normally different payment terms) then teh sikmplest way is to use an SQL Computed column: Specify Computed Columns in a Table | Microsoft Docs[^]
A specification of
SQL
(DATEADD(day,(100),[InsertDate]))
would do it.

But I'd do it in C# using DateTime.AddDays instead as it allows for flexibility later.
 
Share this answer
 
Comments
Pasupathy Msc 8-Feb-18 0:40am    
the above code show only the end date
sir want the output for this format
02/02/2018
03/02/2018
...................
...............
.................
13/05/2018

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900