Results 1 to 6 of 6

Thread: view

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    Cleveland,Oh
    Posts
    95

    view

    Hi All:
    I have two tables: event and event_times.
    Event is connected to event_times with left outer join. When I run my view, I get result set as if the two tables are inner joined. What am I doing wrong? This is on sql 2000.

    Thanks

    SELECT dbo.events.event_title
    FROM dbo.events LEFT OUTER JOIN
    dbo.event_times ON dbo.events.event_id = dbo.event_times.event_id
    Zus

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    This actually should go in the Databases forum, but anyways...
    What results does this bring back?
    Code:
    SELECT
     events.event_id,
     events.event_title,
     event_times.event_id,
     event_times.event_time
    FROM
     events 
    LEFT OUTER JOIN
     event_times ON events.event_id = event_times.event_id
    If you include other fields you may be able to really see what the
    issue may be.

    Ex.
    Code:
    events                       event_times
    Id   Title                   Id             Time
    123  Crash                   123           12:00
    124  Stop                    <null>
    125  Start                   125            1:00
    
    Query results
    123 Crash                    12:00
    124 Stop                     <null>
    125 Start                     1:00
    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    Cleveland,Oh
    Posts
    95

    resolved:Left outter join

    Hi :
    Thanks for getting back to me. Actually I was able to solve this connecting all the tables to left outer joins. However, I have a another question for you.


    How can I determine if a certain file exist. For example:


    SaveFile = App.Path & "\Rpts" & "\RoomSetup.xls"

    If SaveFile <> "" Then
    Kill SaveFile 'Delete the previous file.
    End I

    This works as long as there is a file,if there is no file, it errors out.

    Thanks
    Zus

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    VB Code:
    1. Option Explicit
    2.  
    3. Private Const OF_EXIST = &H4000
    4. Private Const OFS_MAXPATHNAME = 128
    5.  
    6. Private Type OFSTRUCT
    7.     cBytes As Byte
    8.     fFixedDisk As Byte
    9.     nErrCode As Integer
    10.     Reserved1 As Integer
    11.     Reserved2 As Integer
    12.     szPathName(OFS_MAXPATHNAME) As Byte
    13. End Type
    14.  
    15. Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long
    16.  
    17. Public Function FileExists(ByVal Fname As String) As Long
    18.  
    19.     Dim lRetVal As Long
    20.     Dim OfSt As OFSTRUCT
    21.    
    22.     lRetVal = OpenFile(Fname, OfSt, OF_EXIST)
    23.     If lRetVal = 1 Then
    24.         FileExists = 1
    25.     Else
    26.         FileExists = 0
    27.     End If
    28.    
    29. End Function
    Enjoy.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    Cleveland,Oh
    Posts
    95

    Resolved:Delete File

    Hi RobDog888:
    Thanks
    Zus

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    No prob.
    Glad to help.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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