codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Calcluate Date Difference [Seriouslt a new challenge]  police911 at 08:32 on Thursday, November 15, 2007
 

Hi,

I am Using ASP.NET. I have made a webform where i kept two text boxes. The texboxes are for accepting the dates.

In my database i made three columns where i want the value to be stored.

Now the requirement is:

I wans a help in writing the code for inserting the dates in the colums and simultaneouslt calculating the difference between two dates and putting it in the 3rd column.


Lets Say:

Start Date : 11/14/2007 (the value is typed in textbox)

Close Date : 11/15/2007 (the value is typed in textbox)


Now when i click the submitt button

the date from both the text boxes should enter the data bsse and the difference between them should also be get entered.

The data base has 3 columns

Start_dt , Close_dt, Date_diff


I am able to insert the dates in the columns on clicking the submitt button.

for that i am using insert command

Insert Table_name (start_dt, close_dt, date_diff) values ('" + textbox1 + "', '" + Textbox2 + "', datediff(day, start_dt,close_dt)

the type of date column is datetime and the type of tifference column is numeric.

the values from textboxes are entering properly but i am not getting the calculated TAT for them as well.

Please help me on this.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Write text strings to Serial Port
•  Calcluate Date Difference [Seriouslt a new challenge]
•  source code to generate perl library
•  Plz Help Me Out...!!! I want to add a crystal report to my application
•  Floating div
•  Re: open excel file in html page
•  Such A Newbie - Mailing Label Program
•  Classified Script
•  Re: saving??


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007