paulthepaddy
Well-known member
Hi Guys, not sure how to put this question so here goes.
I am looking to retrieve records from a database and then create a new value from what was retrieved, so example
I am looking to search a table For order Numbers related to a Car. the Order Number is going to be made up as follows
Car Reg + Date + Char + number
Dim partOrdernumber As String = reg.Replace(" ", "") + Format(D_Date, "ddMMyy") + StrConv(inital, VbStrConv.Uppercase)
CEZ2525210713P1
CEZ2525210713P2
The problem im having is the number if two order numbers are done on the same date same car same person(which is likely) then i need to use the last number to define them
but how would i do this. this is what i have so far
i need to search for 'CEZ2525210713P' and get all results to then determine what the next number is going to be
im really quite lost here so any help is much appropriated
I am looking to retrieve records from a database and then create a new value from what was retrieved, so example
I am looking to search a table For order Numbers related to a Car. the Order Number is going to be made up as follows
Car Reg + Date + Char + number
Dim partOrdernumber As String = reg.Replace(" ", "") + Format(D_Date, "ddMMyy") + StrConv(inital, VbStrConv.Uppercase)
CEZ2525210713P1
CEZ2525210713P2
The problem im having is the number if two order numbers are done on the same date same car same person(which is likely) then i need to use the last number to define them
but how would i do this. this is what i have so far
VB.NET:
Dim con As SqlClient.SqlConnection = WhatConnection()
Dim CompleteOrderNumber As String
Dim partOrdernumber As String = reg.Replace(" ", "") + Format(D_Date, "ddMMyyyy") + StrConv(inital, VbStrConv.Uppercase)
Dim CMD As New SqlClient.SqlCommand("SELECT * FROM OrderNumbers WHERE OrderNumber LIKE @OrderNumber", con)
CMD.Parameters.AddWithValue("@OrderNumber", partOrdernumber)
i need to search for 'CEZ2525210713P' and get all results to then determine what the next number is going to be
im really quite lost here so any help is much appropriated