Click here to Skip to main content
16,006,709 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: no headings Pin
Dave Kreskowiak25-Sep-06 4:20
mveDave Kreskowiak25-Sep-06 4:20 
QuestionDataGridView2005 Pin
Jeeva Jose23-Sep-06 23:38
Jeeva Jose23-Sep-06 23:38 
Questiondataset not contained the excel first row Pin
viji]23-Sep-06 21:03
viji]23-Sep-06 21:03 
AnswerRe: dataset not contained the excel first row Pin
Guffa23-Sep-06 21:26
Guffa23-Sep-06 21:26 
QuestionNumber Generation Pin
Chira Chandra23-Sep-06 16:40
Chira Chandra23-Sep-06 16:40 
AnswerRe: Number Generation Pin
Christian Graus23-Sep-06 20:00
protectorChristian Graus23-Sep-06 20:00 
GeneralRe: Number Generation Pin
Chira Chandra24-Sep-06 3:43
Chira Chandra24-Sep-06 3:43 
GeneralRe: Number Generation Pin
Christian Graus24-Sep-06 10:49
protectorChristian Graus24-Sep-06 10:49 
Ah - I see.

OK, well, if the numbers are just a sequence of 1,2,3,4 for each date, you want to write a stored proc which does this. It will check for the highest number in the table where the date is today, and then store a new number and return it, the number is one higher.

If you have a table called Serials with two entries, serial as an int and date as a datetime, this will work:

create proc InsertSerial @serial int out
as
begin

select @serial = count(*) from Serials where DATEPART(day, date) = DATEPART(day, GETDATE())
and DATEPART(month, date) = DATEPART(month, GETDATE())
and DATEPART(year, date) = DATEPART(year, GETDATE())

set @serial = @serial + 1

insert into Serials (Serial, Date) values (@serial, GETDATE())


end

I'm not sure if there's another way to compare the date without the time, but I tested this and it works fine.


Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog

GeneralRe: Number Generation Pin
Chira Chandra24-Sep-06 21:42
Chira Chandra24-Sep-06 21:42 
GeneralRe: Number Generation Pin
Christian Graus24-Sep-06 21:46
protectorChristian Graus24-Sep-06 21:46 
QuestionNeed Help for coding VB.NET Pin
Little Ducky23-Sep-06 6:51
Little Ducky23-Sep-06 6:51 
AnswerRe: Need Help for coding VB.NET Pin
Christian Graus23-Sep-06 19:58
protectorChristian Graus23-Sep-06 19:58 
Questionoption button on a wmi script Pin
ashtonnew23-Sep-06 5:53
ashtonnew23-Sep-06 5:53 
AnswerRe: option button on a wmi script Pin
Dave Kreskowiak25-Sep-06 4:41
mveDave Kreskowiak25-Sep-06 4:41 
QuestionObject Oriented Question working in form Pin
Amr M. K.23-Sep-06 5:24
Amr M. K.23-Sep-06 5:24 
AnswerRe: Object Oriented Question working in form Pin
Guffa23-Sep-06 5:50
Guffa23-Sep-06 5:50 
GeneralRe: Object Oriented Question working in form Pin
Amr M. K.23-Sep-06 6:01
Amr M. K.23-Sep-06 6:01 
GeneralRe: Object Oriented Question working in form Pin
Dave Kreskowiak23-Sep-06 6:52
mveDave Kreskowiak23-Sep-06 6:52 
GeneralRe: Object Oriented Question working in form Pin
Amr M. K.23-Sep-06 8:24
Amr M. K.23-Sep-06 8:24 
AnswerRe: Object Oriented Question working in form Pin
Guffa23-Sep-06 10:40
Guffa23-Sep-06 10:40 
GeneralRe: Object Oriented Question working in form Pin
Dave Kreskowiak23-Sep-06 11:10
mveDave Kreskowiak23-Sep-06 11:10 
AnswerRe: Object Oriented Question working in form Pin
Christian Graus23-Sep-06 20:06
protectorChristian Graus23-Sep-06 20:06 
QuestionI need 2 know Pin
Khalefa_1323-Sep-06 3:19
Khalefa_1323-Sep-06 3:19 
AnswerRe: I need 2 know Pin
Dave Kreskowiak23-Sep-06 5:26
mveDave Kreskowiak23-Sep-06 5:26 
AnswerRe: I need 2 know Pin
Christian Graus23-Sep-06 20:08
protectorChristian Graus23-Sep-06 20:08 

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.