Welcome to SPN

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

Sign Up Now!

Two doubts

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

Tags:
  1. Wormer

    Wormer
    Expand Collapse
    Guest

    I'm almost sure that it'll be two "stupid" questions, anyway... :)

    1) I have a lot of sql scripts and I want to execute it, but I can't...
    it says that there are illegal caracteres after the script (the first
    one), after the ";".
    Is there any way to do it ?

    2) I'm trying to use current date in a clause. I tried "Date()",
    "Now()" on structure mode, but it says that it's illegal. Then I tried
    on "SQL mode" and it says the samething. Example:

    SELECT Geral.Nome, Geral.Contrato, Geral.DataEntrada, Geral.Filial,
    Geral.CodFase, Geral.Andamento, Geral.Veiculo, Geral.Produto,
    Geral.CodResp, Geral.CPN
    FROM Geral
    WHERE (Geral.DataEntrada = Date());

    Please :s
    Thanks in advance.
     
  2. Loading...

    Similar Threads Forum Date
    SGPC to clear doubts on authenticity of Guru Gobind Singh Kalgi Sikh Sikhi Sikhism Jul 2, 2009
    Answering Doubts of Dalbeer Singh Ji Regarding Bani onto the Tenth Master Dasam Granth Jun 21, 2009
    Answering the wrong doubts about Bani onto Tenth Master Hard Talk Dec 25, 2006
    Give up your doubts, & utter the Naam ! Interfaith Dialogues Feb 23, 2006
    Dispel your doubts Interfaith Dialogues Sep 2, 2005

  3. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Wormer,

    1.) To execute SQL Scrips within Access, you can create a table that
    includes a valid SQL statement in each record. Then use VBA code to walk the
    table, executing each script one after the other. I have an example that I
    created using the scripts given here:

    http://www.sql-scripts.com/members/ScriptDetails.aspx?S_ID=74

    The VBA code will need to accomodate any embedded single or double quotes in
    the data values. For example, the following script, as written, will not work

    Insert into CountryCities (CountryA2Code ,CityName ,IsCapital)
    values('AG','Saint John's',1);

    I have a sample database that I'm willing to share with you. If you are
    interested, send me a private e-mail message with a valid reply-to address.
    My e-mail address is available at the bottom of the contributor's page
    indicated below.

    Please do not post your e-mail address (or mine) to a newsgroup reply. Doing
    so will only attract the unwanted attention of spammers.


    2.) The following query works fine in the sample Northwind database, as long
    as you change a few Order Dates to today's date:

    SELECT Customers.CompanyName, Orders.OrderID, Orders.OrderDate
    FROM Customers
    INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
    WHERE Orders.OrderDate=Date();

    I'm not sure why you are having a problem using Date() in your criteria.
    Check to ensure that you do not have any missing references.

    Solving Problems with Library References (Allen Browne)
    http://allenbrowne.com/ser-38.html

    Access Reference Problems (Doug Steele)
    http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

    Fixing Missing References (Jeff Conrad)
    http://home.bendbroadband.com/conradsystems/accessjunkie/references.html


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________

    "Wormer" wrote:

    > I'm almost sure that it'll be two "stupid" questions, anyway... :)
    >
    > 1) I have a lot of sql scripts and I want to execute it, but I can't...
    > it says that there are illegal caracteres after the script (the first
    > one), after the ";".
    > Is there any way to do it ?
    >
    > 2) I'm trying to use current date in a clause. I tried "Date()",
    > "Now()" on structure mode, but it says that it's illegal. Then I tried
    > on "SQL mode" and it says the samething. Example:
    >
    > SELECT Geral.Nome, Geral.Contrato, Geral.DataEntrada, Geral.Filial,
    > Geral.CodFase, Geral.Andamento, Geral.Veiculo, Geral.Produto,
    > Geral.CodResp, Geral.CPN
    > FROM Geral
    > WHERE (Geral.DataEntrada = Date());
    >
    > Please :s
    > Thanks in advance.
     
  4. Wormer

    Wormer
    Expand Collapse
    Guest

    Tom, thanks a lot. I'm sending you an email about the question #1.
     
  5. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

Share This Page