Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Query Parameters from an external file

Discussion in 'Information Technology' started by AMD414, Jul 28, 2006.

  1. AMD414

    AMD414
    Expand Collapse
    Guest

    Is there any way that Access can read in parameters for a query from an
    external file? I currently have the parameters hard coded into the
    query using GETDATE() - 1 and GETDATE(). However, I have been asked to
    make the date range a little more flexible in case the server that this
    will eventually run on is ever down for more than a day. Any and all
    input would be greatly appreciated.
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    The only way to read from an external file would be if you created a linked
    table pointing to that file. You should then be able to include that table
    in your query.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "AMD414" <strokeyourbod@gmail.com> wrote in message
    news:1149012073.755476.180050@i40g2000cwc.googlegroups.com...
    > Is there any way that Access can read in parameters for a query from an
    > external file? I currently have the parameters hard coded into the
    > query using GETDATE() - 1 and GETDATE(). However, I have been asked to
    > make the date range a little more flexible in case the server that this
    > will eventually run on is ever down for more than a day. Any and all
    > input would be greatly appreciated.
    >
     
  4. AMD414

    AMD414
    Expand Collapse
    Guest

    All right. Is there any way to make specific cells in the linked table
    your parameters?
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Depends on the table.

    Ideally, I'd think you'd want a simple table that strictly has one row in
    it. If not, what is the table going to look like? What can you key on in it?

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "AMD414" <strokeyourbod@gmail.com> wrote in message
    news:1149016281.709283.211150@i40g2000cwc.googlegroups.com...
    > All right. Is there any way to make specific cells in the linked table
    > your parameters?
    >
     
  6. AMD414

    AMD414
    Expand Collapse
    Guest

    Douglas J Steele wrote:
    > Depends on the table.
    >
    > Ideally, I'd think you'd want a simple table that strictly has one row in
    > it. If not, what is the table going to look like? What can you key on in it?
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >


    See, that's the problem. I have no idea what the table is going to
    look like. I'm gonna have to try to explain myself as best I can here
    (please bear with me).

    For this project, I was originally asked to use Access to query a
    database of backup jobs done by a certain server at this company.
    (Right now I'm working with a static copy of the database). The query
    needed to be automated and run every day, retrieving the previous day's
    jobs. Since I am a college student at a casual "internship" of sorts,
    I had to do quite a bit of research to figure out how to do all of
    this. Right now the Access query has hard-coded GETDATE() parameters.
    Once I finally had it all done (yesterday) I told my supervisor who
    then asked if the Access query could read in editable date parameters
    from an external text file, for the times that the server goes down and
    more than just the previous day's jobs need to be retrieved. However,
    I am unsure as to how this will stay automated with this new
    requirement and also if it's even possible or not (my supervisor it not
    familiar with Access at all). Before I can go back to my supervisor, I
    either need to A) have it done or B) have complete confidence that what
    he exactly wants is not possible. If VBA code is the answer, I can
    work with that although I am somewhat of a n00b with it.

    Thank you Mr. Steele.
     
  7. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    "AMD414" <strokeyourbod@gmail.com> wrote in message
    news:1149082601.118525.248360@j55g2000cwa.googlegroups.com...
    >
    > Douglas J Steele wrote:
    > > Depends on the table.
    > >
    > > Ideally, I'd think you'd want a simple table that strictly has one row

    in
    > > it. If not, what is the table going to look like? What can you key on in

    it?
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >

    >
    > See, that's the problem. I have no idea what the table is going to
    > look like. I'm gonna have to try to explain myself as best I can here
    > (please bear with me).
    >
    > For this project, I was originally asked to use Access to query a
    > database of backup jobs done by a certain server at this company.
    > (Right now I'm working with a static copy of the database). The query
    > needed to be automated and run every day, retrieving the previous day's
    > jobs. Since I am a college student at a casual "internship" of sorts,
    > I had to do quite a bit of research to figure out how to do all of
    > this. Right now the Access query has hard-coded GETDATE() parameters.
    > Once I finally had it all done (yesterday) I told my supervisor who
    > then asked if the Access query could read in editable date parameters
    > from an external text file, for the times that the server goes down and
    > more than just the previous day's jobs need to be retrieved. However,
    > I am unsure as to how this will stay automated with this new
    > requirement and also if it's even possible or not (my supervisor it not
    > familiar with Access at all). Before I can go back to my supervisor, I
    > either need to A) have it done or B) have complete confidence that what
    > he exactly wants is not possible. If VBA code is the answer, I can
    > work with that although I am somewhat of a n00b with it.
    >
    > Thank you Mr. Steele.
    >
     
  8. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    "AMD414" <strokeyourbod@gmail.com> wrote in message
    news:1149082601.118525.248360@j55g2000cwa.googlegroups.com...
    >
    > Douglas J Steele wrote:
    > > Depends on the table.
    > >
    > > Ideally, I'd think you'd want a simple table that strictly has one row

    in
    > > it. If not, what is the table going to look like? What can you key on in

    it?
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >

    >
    > See, that's the problem. I have no idea what the table is going to
    > look like. I'm gonna have to try to explain myself as best I can here
    > (please bear with me).
    >
    > For this project, I was originally asked to use Access to query a
    > database of backup jobs done by a certain server at this company.
    > (Right now I'm working with a static copy of the database). The query
    > needed to be automated and run every day, retrieving the previous day's
    > jobs. Since I am a college student at a casual "internship" of sorts,
    > I had to do quite a bit of research to figure out how to do all of
    > this. Right now the Access query has hard-coded GETDATE() parameters.
    > Once I finally had it all done (yesterday) I told my supervisor who
    > then asked if the Access query could read in editable date parameters
    > from an external text file, for the times that the server goes down and
    > more than just the previous day's jobs need to be retrieved. However,
    > I am unsure as to how this will stay automated with this new
    > requirement and also if it's even possible or not (my supervisor it not
    > familiar with Access at all). Before I can go back to my supervisor, I
    > either need to A) have it done or B) have complete confidence that what
    > he exactly wants is not possible. If VBA code is the answer, I can
    > work with that although I am somewhat of a n00b with it.


    Does that mean someone is going to be using Access to do these queries (as
    opposed to, say, a VB program running a query)?

    I'd say your best bet would be to create a form that has text boxes on it
    for the dates. Pre-fill them to whatever values are appropriate (your
    GETDATE() stuff today), but let the user override them. Have your queries
    get the values from that form, and you should be fine.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)
     

Share This Page