borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (conecting to local db and internet)Next Topic (displaying images in VB6 datagrid) New Topic New Poll Post Reply
AndreaVB Forum : Database : How to modify the code to change the date format?
Poster Message
sneha
Level: Scholar

Registered: 28-03-2006
Posts: 29

icon How to modify the code to change the date format?

Hi,

How can I modify the following code to use date format ?

Now the date format is like: 25/01/2006 (dd/mm/yyyy)
and
I would like to change it to :01/25/2006 (mm/dd/yyyy)

The code is as follows:

Private Sub cmdPaid_Click()

If lvwCollections.SelectedItem.Selected = True Then
db.Execute "Update Collections " _
         & "Set Paid = '" & txtFill.Text & "' where DepositDate = #" & Trim(lvwCollections.SelectedItem.ListSubItems(1).Text) & "#" _
         & " And FileNumber = '" & Trim(lvwCollections.SelectedItem.ListSubItems(5).Text) & "'"
lvwSales.Refresh
LoadListViews
End If
End Sub



Regards,

Snehaasd

____________________________
Sneha

26-06-2006 at 05:02 PM
View Profile Send Email to User Show All Posts | Quote Reply
s.ostwal
Level: Whizz Kid


Registered: 03-08-2006
Posts: 16
icon Re: How to modify the code to change the date format?

Hi,

Just make some changesin ur code so that u can get ur result. see the changes


Private Sub cmdPaid_Click()

If lvwCollections.SelectedItem.Selected = True Then
db.Execute "Update Collections " _
         & "Set Paid = '" & txtFill.Text & "' where DepositDate = #" & Foramt(CDate(Trim(lvwCollections.SelectedItem.ListSubItems(1).Text)), "MM/dd/yyyy") & "#" _
         & " And FileNumber = '" & Trim(lvwCollections.SelectedItem.ListSubItems(5).Text) & "'"
lvwSales.Refresh
LoadListViews
End If
End Sub



Regards,

Swapnil

21-08-2006 at 03:58 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : How to modify the code to change the date format?
Previous Topic (conecting to local db and internet)Next Topic (displaying images in VB6 datagrid) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder