+ Reply to Thread
Results 1 to 2 of 2

Force record return from SQL Download

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    54

    Force record return from SQL Download

    Hi there,

    Don't know whether this is the correct sub-forum for this (Please move if it isn't)

    Does anyone know of a way to force (either on the VBA or SQL side) a query to return zero for results not in a query.

    So say you have information for A, B, C, E in the Database, but you want to return data for A, B , C, D, E, F, is there any way to get excel to return D = 0, F = 0 in what is copied to the excel spreadsheet?

    In context, from the code below, I want to return info for all of the currencies listed in the below query (but zeros if nothing exists in the database table.)

    I'm not sure whether using a .find method would work necessarily, as I have to copy about 6 similar recordsets next to each other (all for currencies), and there may be info posted for a currency on one recordset, but not on another.

    Thanks in advance


    Here's my code:
    Please Login or Register  to view this content.
    As you might be able to see from the code, my end goal is to copy across all combinations of the contents of the three arrays next to each other in a sheet. (Which I will then use for an index & match query). I'm fairly sure of how I can do this, its just making sure that the same number of rows are returned for each query (so that which line refers to which currency stays constant)
    Last edited by Authentik8; 08-16-2012 at 03:45 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Force record return from SQL Download

    Can't you just check the value of the returned recordset? If zero or no records manually put a 0 in?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1