I have a field of Issue date which takes the date of that very day when i fire the query now I want that field of Return Date in my data base should take the date while adding 14days to it?
How do i do that?

Try this,

Dim Issudate As Date
        Issudate = Date.Now
        MessageBox.Show(Issudate.AddDays(14).ToShortDateString())

Using Query

SELECT        paper_date + 5 AS [Start + 5]
FROM            TableName

Hope this will help you...

Edited 5 Years Ago by bhagawatshinde: n/a

The data entry has to go into the database not message box .
How do i proceed?

If ddlMember.SelectedIndex = "2" Then
    Dim Issudate As Date
    Dim DueDate As Date
Issudate = Date.Now DueDate = Issudate.AddDays(14).ToShortDateString()
clscommon.executeNonQuery("insert into DAV_LIB_Book_Transaction(BM_ID,BT_Issue_Dt,BT_MemberType,BT_IssuedTo,BT_Actual_Return_Dt,Active) values ('" & Trim(StrConv(txtBkId.Text, VbStrConv.ProperCase, 0)) & "','" & dt & "','" & Trim(StrConv(txtMemberId.Text, VbStrConv.ProperCase, 0)) & "','" & ddlMember.SelectedValue & "','" & dt & "',1)")


End If

i wrote this code but this doesnt work.

what is the error you have got can u explain and by the way where is the 'Issudate' check the insert query carefully.

der is no error it simply doesnt add up the date.
can u please correct the query ,re-write it and then send it?

Change dt as Issudate

clscommon.executeNonQuery("insert into DAV_LIB_Book_Transaction(BM_ID,BT_Issue_Dt,BT_MemberType,BT_IssuedTo,BT_Actual_Return_Dt,Active) values ('" & Trim(StrConv(txtBkId.Text, VbStrConv.ProperCase, 0)) & "','" & Issudate  & "','" & Trim(StrConv(txtMemberId.Text, VbStrConv.ProperCase, 0)) & "','" & ddlMember.SelectedValue & "','" & Issudate  & "',1)")

Unuserd variable dt can be replaced.

Edited 5 Years Ago by bhagawatshinde: n/a

This question has already been answered. Start a new discussion instead.