Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 hi! newbie here..making our school thesis :)

Author  Topic 

cherrydee
Starting Member

1 Post

Posted - 2011-05-14 : 10:28:29
hi guys. i am an IT student here in the philippines and we are tasked to make a centralized police system which can record potential criminals through thumbmark scanning and can alert the police if that person has existing record. the database can be viewed in all precincts.

the system is about 80% complete. i got a few functions left..
1.)how can i make the textbox display the last idno of my sql table? like if the last record is 009. i want the textbox to display 010.

2.) i have declared date of incident in sql as date. and its format is yyyy-mm-dd. but when i try to view the record in VB, it's format in txtbox is mm-dd-yyy. so when i want to update a field, i have to update the date too. or i will get an error

3.) how to make data report? >.< sorry i only know how to make report in access type not sql. since i want to view the cases under a certain person, if i have 5 tables of cases, wouldn't it be too long?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-05-15 : 06:36:47
1. You can use the max function in SQL as in max(record_number) to get the current maximum value in the sql table. However, doing it this way may not be the most efficient or desired way of doing it. Hard to tell without knowing a lot more details about your tables, data etc.

2. Storing data as data type date is the right thing to do. In VB, text box allows you to specify the format to change the way it is displayed. When you want to save the data back to the database table, depending on how you are interacting with the database, you can reformat it and send it to the database. In general, it is safe to use the format YYYYMMDD for dates, because that format will always be accepted and interpreted correctly by SQL database.

3. SQL database itself does not have any way of generating a report in the normal sense of the word. You can join the 5 tables in a select query and get the data, but to present it as a report, you will need to use something outside of SQL server. SQL Reporting services is a good choice - I think it may even be free depending on the product SKU of your SQL.
Go to Top of Page
   

- Advertisement -