The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.

MS Access Question

DeebaserDeebaser on my way to work in a suit and a tieAhhhh...come on fucking guyRegistered User regular
edited September 2009 in Help / Advice Forum
Im trying to simplify my life and throw a long series of boring queries into an mdb file, but I'm hitting a roadblock with one of my joins.

I need to create a left join invoice_num from my dataset on INVOICE on our accounting database.


invoice_num is stored 100001
INVOICE is stored L100001-000

here's the code I've been using to date to do a quicky equi-join. Should I just temptable this bitch?


i.INVOICE like ("%" + CONVERT(varchar(20), lol.invoice_num) + "%")

Deebaser on

Posts

  • TinuzTinuz Registered User regular
    edited September 2009
    Not sure, but might I suggest not using Access but something which actually plays nice with important standards such as SQL?

    Honestly, I've had nothing but trouble with Access in scientific contexts. It refuses to sync with stuff, packages to interface with other apps are usaully a pain to work with and the support is rather sad (comapred to OS stuff).

    Tinuz on
  • TwoQuestionsTwoQuestions Registered User regular
    edited September 2009
    What are the data types involved? I'm assuming INVOICE is a varchar, and invoice_num is a numeric of some kind.

    Also, where are you defining this join? That might help out.

    TwoQuestions on
    steam_sig.png
  • DeebaserDeebaser on my way to work in a suit and a tie Ahhhh...come on fucking guyRegistered User regular
    edited September 2009
    What are the data types involved? I'm assuming INVOICE is a varchar, and invoice_num is a numeric of some kind.

    Also, where are you defining this join? That might help out.

    you are correct, INVOICE is a varchar and invoice_num is an int. (Why the devs made INVOICE a varchar is a mystery lost to time). There is nothing I can use to map the numbers to the varchar straight out.

    Right now Im performing the join in the WHERE of a simple select.

    Deebaser on
  • DeebaserDeebaser on my way to work in a suit and a tie Ahhhh...come on fucking guyRegistered User regular
    edited September 2009
    Tinuz wrote: »
    Not sure, but might I suggest not using Access but something which actually plays nice with important standards such as SQL?

    I would, but the SQL client that our company uses is pretty gimp. The data Im trying to pull from is on different servers and ODBC through Access would make my life easier.

    Deebaser on
  • solsovlysolsovly Registered User regular
    edited September 2009
    If performance is not a concern, you can simplify future queries by creating a view (query) on the table with INVOICE as a varchar.

    So have a query that is named "CLEAN_INVOICE" that is just a selects the necessary fields from that table and does a convert from varchar to number. Then use that query like a view for all future queries.

    solsovly on
Sign In or Register to comment.