Help with Converting an Access query

Hello:
First time poster and would appreciate some help in converting this Access query into T-SQL so I can use in a Stored Procedure. I don't need help in resolving the syntax for the variables as parameter in the second query, but stuck in writing the first query
in T-SQL . I assume I need some type of nested query with a left join to another query in T-SQL. 
How do I convert this from Access into MS-SQL
SELECT TBL_MONTH.L_Month, TBL_MONTH.L_MonthName
FROM TBL_MONTH LEFT JOIN qry_MonthCheck ON TBL_MONTH.L_Month = qry_MonthCheck.L_Month
WHERE (((qry_MonthCheck.L_Month) Is Null));
qryMonthCheck in Access is defined as
SELECT TBL_MONTH.L_Month, TBL_SIGNOFF.SO_YEAR, TBL_SIGNOFF.SO_USER, TBL_SIGNOFF.SO_LOCATION
FROM TBL_MONTH RIGHT JOIN TBL_SIGNOFF ON TBL_MONTH.L_Month = TBL_SIGNOFF.SO_MONTH
WHERE (((TBL_SIGNOFF.SO_YEAR)=[forms]![frm_signoff]![cboyear]) AND ((TBL_SIGNOFF.SO_LOCATION)=[Tempvars]![tmpVarUserLOC]));

It is very much up to personal taste. For tables I use no prefix at all. Or suffix. I prefer plural: categories, products, etc. For junction tables, I drop the plural in the first entity, for instance productcategories. As for the case, many people prefer
initial uppercase, while I go for lowercase only. But initial uppercase has its points, particularly in documentation. I am a staunch advocate of using case-sensitive collation for metadata. I don't see any point in mixing productcategories, Productcategories,
ProductCategories etc. That can only cause confusion.
As for either entities, I don't use views much, and I don't have any prefix for these either. In fact, several views I've been involved used to be tables once upon a time.
If you want to add a marker to the object name, I recommend using a suffix. It is much easier to find objects in the version control system and other browser, when not everything is cluttered on the same letter. For instance, I typically add _sp at the end
of stored procedure names.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • [ETL]Could you please help with a problem accessing UML stereotype attributes ?

    Hi all,
    Could you please help with a problem accessing UML stereotype attributes and their values ?
    Here is the description :
    -I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
    -Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
    -Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
    s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
    -However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
    Please help
    Thank you

    Hi Dimitris,
    Thank you , a minimal example is provided now.
    Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
    Instructions for reproducing the problem :
    1-Run the uml2etl.etl transformation with the supplied launch configuration.
    2-Open lqn.model.
    There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
    The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
    Thank you
    Mana

  • Help with converting a Nero file

    I have previously converted a dvd insert designed with Nero into a pdf using adobe acrobat in order to send to someone else.  When I tried to do the same thing today with a new Nero designed insert the conversion wouldn't work.  The message said adobe didn't support the program that created the file.  Any ideas?

    thanks for your response.
    When I create a dvd insert or cd label etc using Nero the file extension is nct - nero cover template.  The printer wants the file as a pdf as he can't open Nero files.  I have version 9.3 of acrobat.
    Date: Mon, 18 Jan 2010 21:43:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: help with converting a Nero file
    Nero is simply a CD/DVD burning application and should have no effect on the type of files that will eventually be on the CD/DVD.
    What type of files are you trying to convert and exactly how are you trying to convert them? Plus, it would help to know the version of Acrobat you are using.
    >

  • Help needed in changing Access query to Oracle query

    hello folks,
    I have already posted this question and got some help previously but i have additional query being added to the previous one so thought of seeking some help.here it goes
    Am having an access report which comes from a query. the current query behind the report is a consolidated one and comes from quite a few tables . My requirement is to develop a crystal report( which comes with a native oracle db driver) which should look same as the access report. But am unable to use the access query becoz of its format or something. So anyone please throw some light on this. Any help would be kindly appreciated.
    SELECT Debtor . EVENT_ID,
    Debtor . MEDCAP#,
    Debtor . Client Name,
    Debtor . CLIENT,
    Debtor . Provider ID,
    Debtor . GROUPNUMBER,
    "OPEN" AS Status,
    (IIf(clip_file = "Y", "Clip", "Open")) AS clipStatus,
    IIf(collect_only = "Y", "Collection Only", "Regular Collections") AS Collect ?,
    IIf(IsNull(Principal), 0, principal,
    IIf(IsNull(PAR_FLAG), "N", IIf(PAR_FLAG <> "N", "P", PAR_FLAG)) AS PAR_NPAR_FLAG,
    Right(PatientMemberID, 2) AS Patient Suffix
    FROM Period, Debtor
    INNER JOIN LOB_subtypes ON Debtor . SUBTYPE = LOB_subtypes . SUBTYPE
    WHERE (((Debtor . CLIENT) = "CV1") And ((Period . PeriodName) Is Not Null) And
    ((Debtor . STATUS) = "OPEN") And ((LOB_subtypes . LOB) = "PBA"));
    Thanks

    The expression...
    IIf(IsNull(Principal), 0, principal) - IIf(IsNull(PRORATED_TRANAMT), 0, prorated_tranamt)...is equivalent to...
    NVL(PRINCIPAL, 0) - NVL(PRORATED_TRANAMT, 0)Does that answer your question?
    As for...
    IIf(IsNull(PAR_FLAG), "N", IIf(PAR_FLAG&lt;&gt;"N", "P", PAR_FLAG))...you might try...
    CASE
        WHEN PAR_FLAG IS NULL THEN 'N'
        WHEN PAR_FLAG != 'N' THEN 'P'
        ELSE 'N'
    END

  • Help With converting px to em...

    So, I thought that I would have a go at converting a site from all px to em to help with accessibility and using browser zoom.  I wish I'd never started!
    This is how I approached it.
         1) Set my font to 100%
         2) Change all font sizes to em
         3) Feel smug
         4) Notice that after a couple of ramps up on the zoom the layout goes pear-shaped
         5) Change all width/height dimensions to em
         6) Change all padding/margin dimensions to em
         7) Feel a little tearful
         8) Realise I don't have a back-up style sheet
         9) Re-draw WWW domination plan
         10) Start to make a little progress
         11) Try out the negative zoom
         12) See that screw my layout - don't understand it
         14) Add some min-width/min-height rules
         12) Feel a little tearful...
         13) Came here to be with friends
    I worked out I think, that using flexible units in a fixed environment is going to cause problems.
    I'm having trouble with layout more than text-size.  I think the only thing that will cause me grief with text-size is with nested element and the way that em is inherited but, the site is quite straight forward, apart from a few floated elements.
    I thnk my main problems are with the layout:  Images, background images and how to approach the whold width/height thing.
    Martin
    PS I won't be at my PC for a while so, if  you respond and I don't come back to you, it's not because I'm not interested.  I'm too ashamed and confused to post a live page!

    Hi Martin
    The one thing that confuses people when converting from px to em units is that they think px is a fixed size and em's are flexible, which unfortunately is not true, and just to confuse things even more Microsoft even treat px's as a relative size, (this is actually correct if you look at the css1 spec).
    The best advice I can offer is to start with the layout when converting to em's and worry about the font etc. later, because as they say a pixel is relative.
    PZ

  • Please Help with Converting PDF document to Word Document

    I have downloaded our PDF document to be converted to a word document --- it did not work correctly--we need help with this
    Scott Munsen
    Abbott House -- Mitchell, SD

    Good day Scott,
    I received your document via our File Conversion Issue form.  The root of the problem you're facing is the quality of the scan.  I'm not sure if you were starting with a poor quality hard-copy or simply low DPI settings on your scanner, but the reason the results you received were so different than the PDF was the quality of the input.
    If you're hard copy looks clearer than the PDF file you created, I would suggest increasing the resolution settings on your scanner.
    Please let me know if you have any questions.
    Kind regards,
    David

  • Help with converting FLAC to ALAC while retaining metadata and cover art

    Hi,
    I've decided to embark on the long trek to convert my 18k+ FLAC music library into ALAC. I've decided on ALAC for mainly 2 reasons: iTunes/iPhone/iMac/Sonos compatibility and my desire to keep with a lossless format.
    My library is pretty eclectic; I have quite a bit of classical music along with many other genres. I have spent quite a bit of time maintaining the correct tag information; I do not want to lose any of this info that I've painstakingly added to my library over the years. The tags that I use on my FLAC files are:
    Filename
    Title
    Artist
    Album
    Album Artist
    Disc Number
    Disc Count
    Compilation
    Comment
    Year
    Genre
    Track
    Composer
    Orchestra
    Conductor
    Performer
    Length
    Modified
    Path
    I want to be especially sure that I maintain the data in Composer, Orchestra, Performer and Conductor in my migration to ALAC. I also want to include my CD art in each track (many of which I had to scan since some of my CD's are not available for sale). The CD covers are stored in a "folder.jpg" file in the path of each CD's contents. I would really like the automated conversion process to pick up each "folder.jpg" and embed it in the appropriate tracks.
    I have a license for dbPowerAmp, so I can do the conversion on the Windows side if need be (I have BootCamp set up and use Fusion), but I would prefer to do everything in Mac.
    I am hoping that some of you good folks will offer up comments about the feasibility of this endeavor, and advise me on possible tools to use, paths to take, pitfalls to watch out for, etc.
    Thank you for your time.
    Mike

    I finally got done with the conversion. It took 2 weeks running XLD of 24x7, but at last it's over with.
    I first used iTunes "download missing album art" to start the process. It populated about 50% of my collection, but I found that many of the album art was wrong. For instance, with collections (various artists) it populated the album art from the first track; with others, it put in the wrong album cover for the right CD. These were mostly because iTunes would get a contemporary cover, where my cover was from an older pressing of the disk.
    I purchased a program called TuneUp which has helped with my missing album artwork, and also with correcting typos. But even with using TuneUp, I probably have a couple of weeks worth of work left to do.
    Then comes the renaming of the Classical music tracks.
    Mike

  • Help with count and sum query

    Hi I am using oracle 10g. Trying to aggregate duplicate count records. I have so far:
    SELECT 'ST' LEDGER,
    CASE
    WHEN c.Category = 'E' THEN 'Headcount Exempt'
    ELSE 'Headcount Non-Exempt'
    END
    ACCOUNTS,
    CASE WHEN a.COMPANY = 'ZEE' THEN 'OH' ELSE 'NA' END MARKET,
    'MARCH_12' AS PERIOD,
    COUNT (a.empl_id) head_count
    FROM essbase.employee_pubinfo a
    LEFT OUTER JOIN MMS_DIST_COPY b
    ON a.cost_ctr = TRIM (b.bu)
    INNER JOIN MMS_GL_PAY_GROUPS c
    ON a.pay_group = c.group_code
    WHERE a.employee_status IN ('A', 'L', 'P', 'S')
    AND FISCAL_YEAR = '2012'
    AND FISCAL_MONTH = 'MARCH'
    GROUP BY a.company,
    b.district,
    a.cost_ctr,
    c.category,
    a.fiscal_month,
    a.fiscal_year;
    which gives me same rows with different head_counts. I am trying to combine the same rows as a total (one record). Do I use a subquery?

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    user610131 wrote:
    ... which gives me same rows with different head_counts.If they have different head_counts, then the rows are not the same.
    I am trying to combine the same rows as a total (one record). Do I use a subquery?Maybe. It's more likely that you need a different GROUP BY clause, since the GROUP BY clause determines how many rows of output there will be. I'll be able to say more after you post the sample data, results, and explanation.
    You may want both a sub-query and a different GROUP BY clause. For example:
    WITH    got_group_by_columns     AS
         SELECT  a.empl_id
         ,     CASE
                        WHEN  c.category = 'E'
                  THEN  'Headcount Exempt'
                        ELSE  'Headcount Non-Exempt'
                END          AS accounts
         ,       CASE
                        WHEN a.company = 'ZEE'
                        THEN 'OH'
                        ELSE 'NA'
                END          AS market
         FROM              essbase.employee_pubinfo a
         LEFT OUTER JOIN  mms_dist_copy             b  ON   a.cost_ctr     = TRIM (b.bu)
         INNER JOIN       mms_gl_pay_groups        c  ON   a.pay_group      = c.group_code
         WHERE     a.employee_status     IN ('A', 'L', 'P', 'S')
         AND        fiscal_year           = '2012'
         AND        fiscal_month          = 'MARCH'
    SELECT    'ST'               AS ledger
    ,       accounts
    ,       market
    ,       'MARCH_12'          AS period
    ,       COUNT (empl_id)       AS head_count
    FROM       got_group_by_columns
    GROUP BY  accounts
    ,            market
    ;But that's just a wild guess.
    You said you wanted "Help with count and sum". I see the COUNT, but what do you want with SUM? No doubt this will be clearer after you post the sample data and results.
    Edited by: Frank Kulash on Apr 4, 2012 5:31 PM

  • Help with converting hex to date and time

    Hi!
    I am using snmp4j libraries to walk the mib tree. The system date is getting returned in 11 hexadecimal octets. I require help in converting it to date and time. I looked up the RFC convention of what each octets represent. Require help with conversion.
    Eg: 07:db:06:0a:29:1d:00:2b:05:1e
    Thanks,

    Octets Contents Range
    1-2 year 0..65536
    3 month 1..12
    4 day 1..31
    5 hour 0..23
    6 minutes 0..59
    7 seconds 0..60
    (use 60 for leap-second)
    8 deci-seconds 0..9
    9 direction from UTC '+' / '-'
    10 hours from UTC 0..13
    11 minutes from UTC 0..59
    For example I just took the time an hour ago it came out as
    07:db:06:13:12:11:1a:00:2b:05:1e
    I have to convert this as a date long value to send it.
    Do I have to write an utility of my own to do it?

  • Help with converting array of sentences in to array of words.

    Hi! I'm having a problem with converting an array of sentences (about 50) into 1000 separate words into an word array. No use of tokenizers, classes (pre-made) just clear proggramming.
    Thanks in advance!

    Until you come up with a question, check these out:
    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/learning/new2java/index.html
    http://javaalmanac.com
    http://www.jguru.com
    http://www.javaranch.com
    Bruce Eckel's Thinking in Java
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java

  • Need help with converting a query to maxDB

    Hello,
    I'm experienced in SQL Server however not yet familiar with the MaxDB functions very well.
    I need to convert the following WHERE clause in a query to one that can run on MaxDB:
    WHERE DATEADD(MILLISECOND, Timestamp, '19000101') >= DATEADD(YEAR, DATEDIFF(YEAR, '19000101', DATEADD(DAY, -10, GETDATE())), '19000101')
       AND DATEADD(MILLISECOND, Timestamp, '19000101') < DATEADD(DAY, -9, DATEADD(DAY, DATEDIFF(DAY, '19000101', GETDATE()), '19000101'))
    Rgds,
    Roy

    Hi Elke,
    Thanks, I'll try that.
    I don't want any data from the last 9 days not from the first 9 days of the year, so if today is 17/5/2010 the BETWEEN will be: 1/1/2010 and 8/5/2010 and if today was 10/2/2010 for example the BETWEEN would have been: 1/1/2010-1/2/2010.
    HOWEVER, if today was 5/1/2010 then the BETWEEN should automatically adjust itself to 2009 and check for: 1/1/2009-27/12/2009 since when rolling 5/1/2010 10 days backwards we're still in 2009, so the query needs to first rollback and then make the dates reference.
    I don't believe that what you have provided answers these requirements but than again I might be wrong...
    Rgds,
    Roy

  • Help with a "save as" query or an alternative suggestion

    Hi all
    Hope someone can spread some light on this for me, im rather new to using adobe pro - and never ventured into java scripts as yet..
    I have created a pdf document with various text boxes within the document. The document will be pushed out to external users who will only have access to adobe reader.
    My query is this:
    I've created a save button, but can the file name automatically be set to include the data in one of the text fields. I still want the user to chose where to save the document but want the file name to be fixed to the data in the relevant text box.
    If it can be done is it a relatively straight forward procedure.
    If this is not possible, then as an alternative is it possible ible to create maybe a Warning or pop up box after clicking on the "save as" button to prompt the user to save with a different file name to avoid saving over previous versions etc.
    Again if this is this possible, is it difficult to achieve?
    Many thanks in advance for any help!
    Cheers
    Adam

    This tutorial contains a lot of information about saving a file in Acrobat
    using JavaScript:
    http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
    The bottom line is that in order to do it you must have a script installed
    on the local machine.
    The alert is possible, but at the moment it is displayed the user can no
    longer cancel the save command, so you can't really tell them to cancel it
    at that time...

  • Oracle SQL HELP with convert GMT to EST and DST and Date offset

    Hi, I have a query that does not seem to work trying to convert a date field that is in GMT to est and using extract(timezone_hour FROM TO_TIMESTAMP_TZ as an offsetr
    HEre is my sql
    dtl.start_dt_gmt + (extract(timezone_hour FROM TO_TIMESTAMP_TZ( dtl.start_dt_gmt,'DD-MON-YYYY HH24:MI:SS TZH:TZM'))/24 ) START_DT_Local
    If the date (dtl.start_dt_gmt) is may 1 and gmt starts at 04:00 AM , the extract offset produces -4
    However, if the date (dtl.start_dt_gmt) is Feb 1 which begins at 05:00 AM GMT, the date offset still gives 04. What am i doing wrong? Any help would be appreciated. Thanks.
    Saul

    If your data is not associated with timezone then you'll have to use something like
    case when dt between A and B then dt-1/24 else dt end; <-- This will give you 1 hour back of EDT. So, as far as concern at database level, it is nothing to do at db level, because db is used by application, so you need to code in the app.
    Oracle never actually changes a TIMEZONE column value when you set your system to be on daylight savings time. There are several built-in DST DATE conversion functions for changing to daylight savings time:
    current_date
    current_timestamp
    localtimestamp
    dbtimezone
    sessiontimezone
    extract
    from_tz
    to_timestamp
    to_timestamp_tz
    to_yminterval tz_offset
    http://dba-oracle.com/t_oracle_daylight_saving_time_dst_date_conversion.htm
    Regards
    Girish Sharma

  • Help with NAS Remote Access

    Here's what I have:
    Synology DS212J
    Airport Extreme Base Station Gen 4 running latest firmware
    Running Lion
    Here's what I have done:
    Changed NAS to use Manual Configuration. IP set to: 10.0.1.14 (after reading some forums here and there I have now changed this to 10.0.1.202 (to be outside the range of DCHP address)
    In Airport Extreme I have configured Port Forwarding for port 80 and 7000 entering the private ip of the NAS 10.0.1.14 and now 10.0.1.202 and filled in the TCP ports with the appropriate port, restarted router.
    After reading more posts in the forums I checked the NAS and my Mac Firewalls. Nothing...not turned on. I have since gone back into the NAS Firewall settings after reading a post to allow access for Photostation, File station...just in case it makes a differnece
    Obtained a static IP from my ISP - ISP does not block any ports
    Canyouseeme.org always gives a Timed out message when I try and check port forwarding
    Everything works perfect on LAN...just remote I can't seem to get.  Some nice iphone apps I'd like to use remotely and use my Air to access when away from home.
    Questions:
    Is it necessary to also configure a Static IP on my Airport Extreme...I haven't as my understanding is that only the DS needs one?  If I do could some kindly step this out for me?
    I have previously changed some settings in my router for unblock-us http://support.unblock-us.com/customer/ ... 27...could this be the problem?
    Thanks to anyone that might be able to help. I can post screen shots also or could send privately! I have noted that you must be at an outside computer to test access and of course tried that as well...but understand Canyouseeme.org should still say it can see the open port when I test from my network? I also have a DDNS and everything there shows Normal.
    Hoping for something obvious and stupid on my part that someone can point out!

    so if i understand correctly this should work?
    WAN IP 208.160.90.22
    router ip address 192.168.1.1
    camera ip 192.168.1.200
    to access the camera i would type in http://208.160.90.22:1024
    thanks greatly!  i'm trying to use this camera to monitor a boiler to make sure it's operating in this cold weather we are having...

  • Need help with converting date format to decimal in SSRS expression.

    Hi all,
    I have a decimal data type column with a record in the following format 20150219 --> yyyyMMdd. And I am trying to convert the return value from SSRS date/time parameter to a decimal value.
    The TMDTOP column is the decimal data type with date records in yyyyMMdd format.
    My return parameter is the following:
    =IIf(IsNothing(Parameters!SystemDate.Value),Fields!TMDTSY.Value,CDec(Format(Parameters!SystemDate.Value,"yyyyMMdd"))) 
    When I try to run the report I get the following error:
    Failed to evaluate the FilterValue of the DataSet ‘DataSet1’. (rsFilterEvaluationError)
    I appreciate if anyone can help me on solving this problem.
    Thanks in advance.

    why casting date to decimal here? Can you explain?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • One Image for dual and single processor G5 machines

    I'm working in a lab that has both single and dual processors G5 machines. There is only one image for both machines and I suspect that we have a few bugs with the single processor machines because of this. Has anyone else used one image for both sin

  • Homesharing for iTunes only shows up on my mac, not my pc.

    I recently bought a HP laptop with windows 8. I downloaded the latest iTunes(11.2.2) on my hp, but on my mac i have iTunes(10.6.3). (I can't upgrade my iTunes on my mac because of hard drive issues.) Naturally I wanted to transfer my music from my ma

  • Can't update to iOS5 or 5.1 on ipod due to error (-43).  How do I get beyond this?

    I have been trying to update to iOS 5 since it was released and was excited about the new update released fixing the bugs, but I still can't get pass the backup stage.  Keep getting an error (-43).  Can anyone help, because Apple cannot.  Delaying my

  • JSP pages not coming in Tomcat

    Hi All, I need a help. I have installed Tomcat 5 in my new laptop. Before this, I have installed JDK-1_5_0_02 and JRE-1_5_0_02. I have added proper CLASSPATH and PATH in Env. Variables. Also, I have replaced replaced tools.jar of tomcat/common/lib by

  • Has anyone resolved the issue of not connecting with other Mac users?

    I was able to use iSight with YAhoo. But, lately when i try to connect to other Mac users with iChat & iSight, I get the "you didn't respond.....message of death". I sent it in to Apple. The full error log, if it matter is going to follow this email.