January 10, 2015 at 10:20 am
Hi I have to create a table with the following
Accountnumber,DOB,FullName,Accountopendate,currentbalance
I am having troubles:
What data type should I use for DOB?
How do I get Account open date automatically generated?
And how do I get the balance displayed?
Can some one please help with the syntax???
Also, the account number is 5 digits and incremental.
Would appreciate your help.
Thanks
January 10, 2015 at 11:07 am
OwnSQL (1/10/2015)
Hi I have to create a table with the followingAccountnumber,DOB,FullName,Accountopendate,currentbalance
I am having troubles:
What data type should I use for DOB?
Use the DATE datatype, unless you're anticipating doing some "per minute" date math in which case you should use DATETIME unless someone is tasking you to write "truly portable code" (heh... which is truly a myth) where you should use DATETIME2.
How do I get Account open date automatically generated?
Add a default to the table that uses GETDATE() or CURRENT_TIMESTAMP.
And how do I get the balance displayed?
There has to be another table that has the transactions in it before this can be done.
Can some one please help with the syntax???
Yes, but this really seems like homework or a class assignment. Lookup CREATE TABLE for SQL Server on Google and give it a try on your own.
Also, the account number is 5 digits and incremental.
Lookup IDENTITY column on Google.
Would appreciate your help.
Understood. I'm trying to help you become a bit self sufficient on these things.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2015 at 7:22 pm
Thanks a lot Jeff. This is my first post and I am glad you replied.
January 10, 2015 at 9:23 pm
The question now is, do you understand? After checking out Google on some of the things I suggested and if you're still having problems, c'mon back and post what you've tried so we can help.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply