Results 1 to 5 of 5

Thread: CREATE TABLE.... Short date field...

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    CREATE TABLE.... Short date field...

    VB Code:
    1. Dim sql As String
    2. sql = "create table [Visits2]"
    3. sql = sql & "("
    4. sql = sql & "[sDate] Date,"
    5. sql = sql & "[Session] Text(1),"
    6. sql = sql & "[Visitors] Memo"
    7. sql = sql & ")"
    8. ConnOBData.Execute sql

    it works, but need my sDate field to be a shortdate field...

    how do i set that? Cheers.
    Wayne

  2. #2

  3. #3
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: CREATE TABLE.... Short date field...

    VB Code:
    1. 'Assuming MS SQL Server
    2. 'This works in MS SQL Server
    3. Dim sql As String
    4. sql = "create table [Visits2]"
    5. sql = sql & "("
    6. sql = sql & "[sDate] [COLOR=Green]smalldatetime[/COLOR],"
    7. sql = sql & "[Session] Text(1),"
    8. sql = sql & "[Visitors] Memo"
    9. sql = sql & ")"
    10. ConnOBData.Execute sql
    Please mark you thread resolved using the Thread Tools as shown

  4. #4

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Re: CREATE TABLE.... Short date field...

    ah, knew there was something i was forgetting...

    its ms access database im using... smalldatetime doesnt work.

    want to store it as small as possible [im assuming if the field is set to short date the time will be dropped. and therefore take less space? ]

    all i need to deal with is the DATE... why bother with the time if i aint gotta
    Wayne

  5. #5

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Re: CREATE TABLE.... Short date field...

    Oh also, just realised, HOW can i make sDate & Session a compound key with the sql statement?
    Wayne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width