Click here to Skip to main content
15,918,668 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: format date Pin
Marcus J. Smith23-Feb-07 8:44
professionalMarcus J. Smith23-Feb-07 8:44 
GeneralRe: format date Pin
jds120723-Feb-07 8:53
jds120723-Feb-07 8:53 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 8:57
professionalMarcus J. Smith23-Feb-07 8:57 
AnswerRe: format date Pin
Marcus J. Smith23-Feb-07 9:01
professionalMarcus J. Smith23-Feb-07 9:01 
GeneralRe: format date Pin
jds120723-Feb-07 9:10
jds120723-Feb-07 9:10 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 9:16
professionalMarcus J. Smith23-Feb-07 9:16 
GeneralRe: format date Pin
jds120723-Feb-07 9:19
jds120723-Feb-07 9:19 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 9:26
professionalMarcus J. Smith23-Feb-07 9:26 
jds1207 wrote:
Dim MyCommand As New Odbc.OdbcCommand("INSERT INTO ls_orderitems (OrderDate, OrderCustomer, OrderAcctNum, OrderType, OrderSoNum, OrderItemPartNum, OrderItemPartDesc, OrderItemQty, OrderItemQtyRec, OrderItemQtyDtRec, OrderItemBO, OrderItemBODt,OrderItemCanceled, OrderItemCanceledDt, OrderItemNotes, OrderItemPONum, OrderItemRetailPrice, OrderItemSalePrice, Status, InsertDate) VALUES('" & CDate(OrderDate).ToString("yyyy-MM-dd") & "','" & OrderCustomer & "','" & OrderAcctNum & "','" & OrderType & "','" & OrderSoNum & "','" & OrderItemPartNum & "','" & OrderItemPartDesc & "','" & OrderItemQty & "','" & OrderItemQtyRec & "','" & CDate(OrderItemQtyDtRec).ToString("yyyy-MM-dd") & "','" & OrderItemBO & "','" & CDate(OrderItemBODt).ToString("yyyy-MM-dd") & "','" & OrderItemCanceled & "','" & CDate(OrderItemCanceledDt).ToString("yyyy-MM-dd") & "','" & OrderItemNotes & "','" & OrderItemPONum & "','" & OrderItemRetailPrice & "','" & OrderItemSalePrice & "','" & Status & "','" & InsertDate & "')")


The stuff in bold, just leave it as CDate(VariableName). Before you run this command do something like If OrderDate.Trim = "" Then OrderDate = DBNull.Value to insert a NULL value instead of trying to convert a blank value to a date.



CleAkO

GeneralRe: format date Pin
jds120723-Feb-07 9:53
jds120723-Feb-07 9:53 
GeneralRe: format date Pin
Marcus J. Smith23-Feb-07 10:04
professionalMarcus J. Smith23-Feb-07 10:04 
GeneralRe: format date Pin
Dave Kreskowiak23-Feb-07 10:27
mveDave Kreskowiak23-Feb-07 10:27 
QuestionCaret Size Pin
Anybloodyid23-Feb-07 7:54
Anybloodyid23-Feb-07 7:54 
AnswerRe: Caret Size Pin
Dave Kreskowiak23-Feb-07 10:25
mveDave Kreskowiak23-Feb-07 10:25 
AnswerRe: Caret Size [modified] Pin
TwoFaced23-Feb-07 11:32
TwoFaced23-Feb-07 11:32 
GeneralRe: Caret Size Pin
Dave Kreskowiak23-Feb-07 14:02
mveDave Kreskowiak23-Feb-07 14:02 
GeneralRe: Caret Size Pin
TwoFaced23-Feb-07 14:31
TwoFaced23-Feb-07 14:31 
GeneralRe: Caret Size Pin
Anybloodyid23-Feb-07 22:53
Anybloodyid23-Feb-07 22:53 
GeneralRe: Caret Size Pin
TwoFaced23-Feb-07 23:51
TwoFaced23-Feb-07 23:51 
GeneralRe: Caret Size Pin
Anybloodyid24-Feb-07 1:22
Anybloodyid24-Feb-07 1:22 
GeneralRe: Caret Size Pin
TwoFaced24-Feb-07 8:28
TwoFaced24-Feb-07 8:28 
GeneralRe: Caret Size Pin
Anybloodyid24-Feb-07 9:42
Anybloodyid24-Feb-07 9:42 
GeneralRe: Caret Size Pin
TwoFaced24-Feb-07 10:14
TwoFaced24-Feb-07 10:14 
GeneralRe: Caret Size Pin
Anybloodyid24-Feb-07 11:11
Anybloodyid24-Feb-07 11:11 
GeneralRe: Caret Size Pin
TwoFaced24-Feb-07 12:54
TwoFaced24-Feb-07 12:54 
GeneralRe: Caret Size Pin
Anybloodyid24-Feb-07 22:47
Anybloodyid24-Feb-07 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.