SQL syntax for expert little help Access 2013

Hi
working example SQL local machine
strData= "SELECT DISTINCT Detail, FamCode as Fam FROM Mat_Family ORDER BY FamCode" 
cmbMatFam.RowSource=strData                                                                                                                                                                             
working example SQL server machine (other computer)           
Public Const ServerConnectionWith_RawMaterial_LV
As  String=  
 "[ODBC;Description=Live;DRIVER=SQLServer;SERVER=SERVER;UID=Name;PWD=Password;DATABASE=RawMaterial_LV]." 
strData= "SELECT DISTINCT Detail, FamCode as Fam FROM " &
ServerConnectionWith_RawMaterial_LV & "Mat_Family ORDER BY FamCode"
cmbMatFam.RowSource = strData
working example SQL local machine
 strData = "SELECT Material_M.M_Code, Material_M.Family_Code, ISNULL(z_TotalBars.Bars, 0) AS tBars, ISNULL(z_TotalRes.rBars, 0) AS rBars, "
      strData = strData & "ISNULL(z_TotalBars.Bars, 0) - ISNULL(z_TotalRes.rBars, 0) AS Bal, Material_M.Material_Fam, Material_M.Type, Material_M.Series, "
      strData = strData & "Material_M.Specific, Material_M.Hardness, Material_M.BarLength, Material_M.Density, Material_M.cPound_Ft, Material_M.cPrice_Pound,"
      strData = strData & "Material_M.cPound_Bar, Material_M.cPrice_Bar, Material_M.cPrice_Date , Material_M.Description "
      strData = strData & "FROM Material_M LEFT OUTER JOIN z_TotalRes ON Material_M.M_Code = z_TotalRes.M_Code LEFT OUTER JOIN "
      strData = strData & "z_TotalBars ON Material_M.M_Code = z_TotalBars.M_Code "
      strData = strData & "WHERE (Material_M.Family_Code = '" & cmbMatFam.Column(1) & "') AND (ISNULL(z_TotalBars.Bars, 0) > 0)"
  Form_frmMaterialLookup.RecordSource = strData
NOT working example SQL server machine (other computer)  ??????
 strData = "SELECT Material_M.M_Code, Material_M.Family_Code, ISNULL(z_TotalBars.Bars, 0) AS tBars, ISNULL(z_TotalRes.rBars, 0) AS rBars, "
      strData = strData & "ISNULL(z_TotalBars.Bars, 0) - ISNULL(z_TotalRes.rBars, 0) AS Bal, Material_M.Material_Fam, Material_M.Type, Material_M.Series, "
      strData = strData & "Material_M.Specific, Material_M.Hardness, Material_M.BarLength, Material_M.Density, Material_M.cPound_Ft, Material_M.cPrice_Pound, "
      strData = strData & "Material_M.cPound_Bar, Material_M.cPrice_Bar, Material_M.cPrice_Date , Material_M.Description "
      strData = strData & "FROM  " &
ServerConnectionWith_RawMaterial_LV
& "Material_M LEFT OUTER JOIN z_TotalRes ON Material_M.M_Code = z_TotalRes.M_Code LEFT OUTER JOIN "
      strData = strData & "z_TotalBars ON Material_M.M_Code = z_TotalBars.M_Code "
      strData = strData & "WHERE (Material_M.Family_Code = '" & cmbMatFam.Column(1) & "') AND (ISNULL(z_TotalBars.Bars, 0) > 0)"
  Form_frmMaterialLookup.RecordSource = strData
Error Message
  Syntax error (missing operator) in query expression 'Material_M.MCode= z_TotalRes.M_Code LEFT OUTHER JOIN z_TotalBars ON Material_M.M_Code = z_TotalBars.M_Cod
Usually I just add                   "
& ServerConnectionWith_RawMaterial_LV & "                                              
to a SQL statement and it works,but not this time
(Tables  Material_M,         z_TotalRes,             z_TotalBars             are in RawMaterial_LV
Database)
Appreciate any suggestion Thanks

parenthesis did the job, now adding
"WHERE (ISNULL(z_TotalBars.Bars, 0) > 0) AND (Material_M.Family_Code = 'BZ')"
Tested working Query
SELECT Material_M.M_Code, Material_M.Family_Code, Material_M.Material_Fam, Material_M.Type,
Material_M.Series,
Material_M.Specific, Material_M.Hardness, Material_M.BarLength, Material_M.Density,
Material_M.cPound_Ft, Material_M.cPrice_Pound,
Material_M.cPound_Bar, Material_M.cPrice_Bar, Material_M.cPrice_Date
, Material_M.Description
FROM
([ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Deco2014$;DATABASE=RawMaterial_LV].Material_M
LEFT OUTER JOIN
[ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Password;DATABASE=RawMaterial_LV].z_TotalRes
ON Material_M.M_Code = z_TotalRes.M_Code)                                                                                            
LEFT OUTER JOIN
[ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Password;DATABASE=RawMaterial_LV].z_TotalBars
ON Material_M.M_Code = z_TotalBars.M_Code
Not working Query
SELECT Material_M.M_Code, Material_M.Family_Code, Material_M.Material_Fam, Material_M.Type,
Material_M.Series,
Material_M.Specific, Material_M.Hardness, Material_M.BarLength, Material_M.Density,
Material_M.cPound_Ft, Material_M.cPrice_Pound,
Material_M.cPound_Bar, Material_M.cPrice_Bar, Material_M.cPrice_Date
, Material_M.Description
FROM
([ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Deco2014$;DATABASE=RawMaterial_LV].Material_M
LEFT OUTER JOIN
[ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Password;DATABASE=RawMaterial_LV].z_TotalRes
ON Material_M.M_Code = z_TotalRes.M_Code)                                                                                            
LEFT OUTER JOIN
[ODBC;Description=Live;DRIVER=SQL Server;SERVER=DSERVER;UID=Super;PWD=Password;DATABASE=RawMaterial_LV].z_TotalBars
ON Material_M.M_Code = z_TotalBars.M_CodeWHERE (ISNULL(z_TotalBars.Bars, 0) > 0) AND (Material_M.Family_Code = 'BZ')
Message Error
Wrong number of arguments used with function in query expression '(ISNULL(z_TotalBars.Bars, 0) > 0) AND (Material_M.Family_Code = 'BZ')
Works this way
WHERE (z_TotalBars.Bars > 0) AND (Material_M.Family_Code = 'BZ')

Similar Messages

  • SQL Syntax for Access database

    This pertains to LV only due to the fact that LV requires a slightly different syntax for SQL statements for use with Access than what you will see in the Access Queries SQL view.  For instance, I discovered that if you use a  ?  for a character placeholder  (can be any single character) in Access, you need to use an  _  (underscore)  for this feature.  I also discoverd that you use a % sign instead of an *  (asterisk) for any number of characters.
    The lat thing I am having trouble with is specifying a range of characters that could be in a certain position in the text field.  For instance, if the first character can be only an alpha between  A and Z, and the next two characters can be numbers anywhere from 1 to 12,  I would use   LIKE "[A-Z][1-12]*"      In LV, the double quotes are are replaced with single quotes but I cannot figure out what to replace the brackets with. 
    The brackets do not return a syntax error but also do not return any results that should fit the pattern.
    I have tried parenthesis, double quotes, using a TO in place of the dash, etc.
    Any input on this is very much appreciated.
    Doug
    I guess sometimes writing the problem out helps one deduce the answer by taking a closer look at what has been tried and what has not.
    So  LIKE "[A-Z][1-12]*"   in Access will be   LIKE ('[A-Z][01-12]%')  in LV.    I hadn't tried the pecent sign in place of the asterisk using the brackets.    Too bad this stuff isn't spelled out in detail somewhere.
    Doug
    "My only wish is that I am capable of learning each and every day until my last breath."

    Thanks Danubio for the links.  The one for the SQL utility may be helpful as I go forward.
    Mike,  yes I am using the connectivity toolkit.  It's what I cut my teeth on and up to this point, has not caused me any issues.   I rarely make changes after implementation but if I do, the use of typedef's keeps it pretty painless.  A brief read on the doc included in your referenced zip file confirms there are alternate methods to talks to the database tables  (I am not a one table programmer).  When time permits, I will do some trials and if warranted, will try some of your techniques at some point.  Simply not enough time currently.
    As I posted intially, I actually solved my problem before there were any replies and included my solution in the first post.  Why there is a syntax difference going from LV to an mdb is an unknown to me but it exists nonetheless.
    Thanks for the input on this
    Doug
    "My only wish is that I am capable of learning each and every day until my last breath."

  • What is the proper SQL syntax for dates input as variable

    Hello,
    I am working on an ASP JavaScript page that requests totals
    from an Access database for a specific date range. I can write the
    SQL statement to query the DB and get the results I need using the
    WHERE statement below.
    ...WHERE LABOR_DATE BETWEEN #7/15/2006# AND #7/18/2006# GROUP
    BY [LABOR].[JOB_NUMBER_NAME]
    I have another page that I want to pass two variables in
    Dreamweaver specifying the date range varBeginDate and varEndDate
    and query the database using the date range input by the user.
    What is the correct syntax for replacing the actual dates in
    the example above with my variable values?

    Short answer - you can't. There's no automatic link between file paths and mounting servers. There are lots of valid reasons for this (e.g. preventing malicious links from automatically opening files from remote servers), but you can get there in a controlled environment.
    You can configure Automounts on any directory. That way whenever any application tries to access a particular path the OS will automatically mount the directory, but it needs to be told in advance which directories (and which servers) to mount.
    For example, if you'd configured your iTunes Library to be saved at /mnt/itunes and it's served from afp://mediaserver.your.net/path/to/itunes you would configure an automount to mount the AFP server at /mnt/itunes.
    Since its an automount, the OS wouldn't mount the server until some process tried to read /mnt/itunes.
    There are several ways of specifying automounts, and for each there are several tutorials online that walk you through the process. Try Mike Bombich's site for a starter.

  • SQL Syntax for hour/date range in Query

    Hi
    I am trying to set up an query for sales order documents procesed in the last 30 minutes to be set as an alert to be run every 30 minutes to the sales manager.  I am having difficulty getting the syntax for the last 30 minutes
    Any suggestions?
    David

    hi,
    I'm not sure query is correct,but u can modify it futher to get correct one.
    SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal FROM ORDR T0 WHERE DateDiff(dd, T0.DocDate ,getdate()) = 0 and
    DateDiff(Minute,T0.DocTime,' ') <= 30
    Jeyakanthan

  • SQL novice looking for a little help

    A little SQL help asked for…because my solution works but runs like a pig.
    I have two tables with a link many-many association table between them with two FK's defined on the PK's in the tables either side of the join.
    CREATE TABLE TABLE1
    ID VARCHAR2(20 BYTE) NOT NULL
    , NAME VARCHAR2(20 BYTE)
    , AGE NUMBER
    , ADDR1 VARCHAR2(20 BYTE)
    , CONSTRAINT TABLE1_PK PRIMARY KEY
    ID
    ENABLE
    CREATE TABLE TABLE2
    ID2 VARCHAR2(20 BYTE) NOT NULL
    , TYPE VARCHAR2(20 BYTE)
    , DATE_CREATED DATE
    , CONSTRAINT TABLE2_PK PRIMARY KEY
    ID2
    ENABLE
    CREATE TABLE LINK_TABLE
    ID VARCHAR2(20 BYTE) NOT NULL
    , ID2 VARCHAR2(20 BYTE) NOT NULL
    , CONSTRAINT LINK_TABLE_PK PRIMARY KEY
    ID
    , ID2
    ENABLE
    ALTER TABLE LINK_TABLE
    ADD CONSTRAINT LINK_TABLE1_FK1 FOREIGN KEY
    ID
    REFERENCES TABLE1
    ID
    ENABLE;
    ALTER TABLE LINK_TABLE
    ADD CONSTRAINT LINK_TABLE2_FK2 FOREIGN KEY
    ID2
    REFERENCES TABLE2
    ID2
    ENABLE;
    Populated with the simple data set below that also establishes the many to many links between table1 and table2.
    Insert into TABLE1 (ID,NAME,AGE,ADDR1) values ('a','jake',23,'london');
    Insert into TABLE1 (ID,NAME,AGE,ADDR1) values ('d','jimmy',26,'lamelane');
    Insert into TABLE1 (ID,NAME,AGE,ADDR1) values ('b','jenny',55,'lakeside');
    Insert into TABLE1 (ID,NAME,AGE,ADDR1) values ('c','jemima',21,'lothian');
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('z','type1',to_date('10-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('x','type1',to_date('09-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('n','type2',to_date('04-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('d','type1',to_date('03-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('e','type1',to_date('03-MAR-13','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('f','type2',to_date('16-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('s','type4',to_date('04-MAR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('w','type3',to_date('05-APR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('h','type1',to_date('02-APR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('v','type2',to_date('23-APR-12','DD-MON-RR'));
    Insert into TABLE2 (ID2,TYPE,DATE_CREATED) values ('k','type3',to_date('30-MAR-12','DD-MON-RR'));
    REM INSERTING into LINK_TABLE
    SET DEFINE OFF;
    Insert into LINK_TABLE (ID,ID2) values ('a','z');
    Insert into LINK_TABLE (ID,ID2) values ('a','x');
    Insert into LINK_TABLE (ID,ID2) values ('a','f');
    Insert into LINK_TABLE (ID,ID2) values ('d','d');
    Insert into LINK_TABLE (ID,ID2) values ('d','e');
    Insert into LINK_TABLE (ID,ID2) values ('b','w');
    Insert into LINK_TABLE (ID,ID2) values ('b','x');
    Insert into LINK_TABLE (ID,ID2) values ('b','v');
    Insert into LINK_TABLE (ID,ID2) values ('a','n');
    Insert into LINK_TABLE (ID,ID2) values ('c','s');
    Insert into LINK_TABLE (ID,ID2) values ('c','k');
    Insert into LINK_TABLE (ID,ID2) values ('a','s');
    Insert into LINK_TABLE (ID,ID2) values ('a','v');
    And thus when queried using the join, gives me this data.
    select t1.*, t2.* from table1 t1, link_table lt, table2 t2
    where lt.id = t1.id
    and t2.id2 = lt.id2;
    ID NAME AGE ADDR1 ID2 TYPE DATE_CREATED
    a jake 23 london f type2 16-MAR-12
    a jake 23 london n type2 04-MAR-12
    a jake 23 london s type4 04-MAR-12
    a jake 23 london v type2 23-APR-12
    a jake 23 london x type1 09-MAR-12
    a jake 23 london z type1 10-MAR-12
    b jenny 55 lakeside v type2 23-APR-12
    b jenny 55 lakeside w type3 05-APR-12
    b jenny 55 lakeside x type1 09-MAR-12
    c jemima 21 lothian k type3 30-MAR-12
    c jemima 21 lothian s type4 04-MAR-12
    d jimmy 26 lamelane d type1 03-MAR-12
    d jimmy 26 lamelane d type1 03-MAR-13
    12 rows selected
    However, what I need is
    for every unique ID in table1, I need the maximum date for in table2 but given that there needs to be a precedence on types in a predefined order, that order being
    type4 trumps type2 which trumps type3 which trumps type1.
    therefore the query I'm looking for will return the type, type4 and it's max date even if other types exist. If no type4's exist for a link from table1.id in table2 then return type2 and it's max date and so forth.
    essentially my query should return
    ID     TYPE     MAX_DATE_CREATED
    a     type4     04-MAR-12
    b     type2     23-APR-12 (since it has no type4 and type2 trumps the other)
    c     type4     04-MAR-12
    d     type1     03-MAR-13 (the highest precedence is type1 and it's highest date is 03-MAR-13)
    Hmmm
    I have achieved this using some odd SQL where I use CASE to score the type against the precedence and then sum the total in an aggregate super query but as I say, it runs like a pig, my real dataset is much bigger than this. Hope there's a nice chap/lady out there who rises to this challenge.
    TIA
    Jenny.

    Hi, Jenny,
    Welcome to the forum!
    Here's one way:
    WITH   got_r_num   AS
         SELECT t1.*
         ,      t2.*
         ,      ROW_NUMBER () OVER ( PARTITION BY  t1.id
                                        ORDER BY         CASE    t2.type
                                              WHEN  'type4'  THEN  1
                                              WHEN  'type2'  THEN  2
                                              WHEN  'type3'  THEN  3
                                              WHEN  'type1'  THEN  4
                                          END
                            ,            t2.date_created     DESC
                          )      AS r_num
         FROM   table1          t1
         ,      link_table      lt
         ,      table2          t2
         WHERE  lt.id      = t1.id
         AND    t2.id2      = lt.id2
    SELECT     *     -- or whatever columns you want
    FROM     got_r_num
    WHERE     r_num     = 1
    ;This is an example of a Top-N Query , where we pick N items (N=1 in this case) from the top of an ordered list (or lists; in this case, we need a separate list for each id.) The analytic ROW_NUMBER function can assign numbers 1, 2, 3, ..., in order, with a separate set of numbers for each id. The tricky part in this problem is getting your trumping order. I used a CASE expresion to map each of the types to a number that reflected the order.
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful!
    Would you like to be even more helpful? Post your best attempt at a query. Even if it performs really poorly, it can help illustrate what you need to do, and maybe give ideas about how to do it. It could be that a small change in what you already have is all that's needed.
    The query above will work in Oracle 9.1 or higher. It never hurts to say which version of Oracle you have.

  • I need a little help accessing my mail on my mac and my iphone 4s after changing my password on Yahoo as someone hacked my account. I can't get mail, I just get Password error every time :(

    Hi people,
    A little stumped for what to do here... I had my Yahoo hacked, changed my yahoo password (Yahoo is the account configured to 'mail' on both my mac and iphone)... however since changing my password I have found I can't access my mail on either with out it asking me to enter my password. When I do, it say's 'Password error'. Sometimes it re-directs me to the actual 'Yahoo' browser saying I need to verify my account, but basically I can't use the mail function on either device now! I know you may suggest deleting the account and re-installing it to each device and I feel this would probably work as well but (and this is the tricky bit)... all my NOTES are configured through Yahoo, only some are through icloud (which is odd). All notes are about 201, icloud about 77 and the rest on Yahoo and when I go to delete the account it says it will also delete all my notes :/ Now, I am a bit of a writer, and these notes are pretty sacred to me so losing them isn't an option. I don't want to lose them. Is there anything any one of you lovely peeps can suggest. It would be much appreciated.
    Tamsyn

    Yes, you have encountered Activation Lock (Find My iPhone Activation Lock - Apple Support). The only way that phone will ever be usable is if the owner the phone is locked to releases it (see: Find My iPhone Activation Lock: Removing a device from a previous owner’s account - Apple Support). If you are lucky the phone is locked to the seller, so you can ask them to unlock it. If the seller is merely a middleman and the previous owner is not the seller it gets much more complicated. It's even possible that you bought a stolen phone, in which case you will never be able to use it and you should return it for a refund.

  • Young CC user looking for a little help

    Hi. I am a student user of many of Adobe's products, and I recently began using the Creative Cloud service, which is currently £15 a month here in Britain but will be hiked to £22.50 a month next year. Since I don't really work much yet (I do a few design/film jobs here and there), the whole thing feels a bit expensive. I do graphic design, photography, film-making and a little bit of web design, which is obviously a lot! Moreover, I am really frustrated with the recent hacks, and as a result I have been consolidating my future with the software. Since the web side of Adobe is neither too unique nor essential, I do not feel so bad losing them. However, programs like Photoshop and After Effects are really irreplaceable, so I am considering purchasing the Production Premium CS6 package for Mac on a student discount, which is around £470 on the Adobe website as an alternative to continuing next year with CC. I own a Mac and a Windows-based laptop, and obviously CC suits this better. All in all, this is a bit of a dilemma, and I'm struggling to come up with a resolution. Does anyone know somewhere I can get the Production Premium cheaper, will I still be able to buy CS6 in June when my year's worth of promotional CC runs out, could I face compatibility issues and, of course, does anyone have any suggestions? All help would be greatly appreciated- thank you!

    To all,
    Here are links to the
    Oracle® Healthcare Transaction Base
    Implementation Guide - 2003
    http://download.oracle.com/docs/cd/B12190_11/current/acrobat/ctb11ig.pdf
    Oracle® Healthcare Transaction Base
    Implementation Guide - 2004
    http://download.oracle.com/docs/cd/B15436_01/current/acrobat/ctb115ig.pdf

  • How to create a DSN-less connection to SQL Server for linked tables in Access

    hey
    i cant understand how i use that Function
    if that information what you need
     stLocalTableName: dbo_user_name
    stRemoteTableName: user_name
    stServer :sedo2015.mssql.somee.com
    stDatabase :sedo2015
    stUsername :sedo_menf_SQLLogin_1
    stPassword :123456789
    how will be that Function??
    please write that Function to me
    '//Name : AttachDSNLessTable
    '//Purpose : Create a linked table to SQL Server without using a DSN
    '//Parameters
    '// stLocalTableName: Name of the table that you are creating in the current database
    '// stRemoteTableName: Name of the table that you are linking to on the SQL Server database
    '// stServer: Name of the SQL Server that you are linking to
    '// stDatabase: Name of the SQL Server database that you are linking to
    '// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection
    '// stPassword: SQL Server user password
    Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String)
    On Error GoTo AttachDSNLessTable_Err
    Dim td As TableDef
    Dim stConnect As String
    For Each td In CurrentDb.TableDefs
    If td.Name = stLocalTableName Then
    CurrentDb.TableDefs.Delete stLocalTableName
    End If
    Next
    If Len(stUsername) = 0 Then
    '//Use trusted authentication if stUsername is not supplied.
    stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes"
    Else
    '//WARNING: This will save the username and the password with the linked table information.
    stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword
    End If
    Set td = CurrentDb.CreateTableDef(stLocalTableName, dbAttachSavePWD, stRemoteTableName, stConnect)
    CurrentDb.TableDefs.Append td
    AttachDSNLessTable = True
    Exit Function
    AttachDSNLessTable_Err:
    AttachDSNLessTable = False
    MsgBox "AttachDSNLessTable encountered an unexpected error: " & Err.Description
    End Function

    thanks more thanks for you
    look i add that code in form
    it worked but i cant add recored  why ??
    Private Sub Form_Open(Cancel As Integer)
    Call AttachDSNLessTable("dbo_user_name", "user_name", "sedo2015.mssql.somee.com", "sedo2015", "sedo_menf_SQLLogin_1", "123456789")
    End Sub

  • Sql syntax for converting a long datatype value in to a integer datatype value

    I have to make a sql query where in i have a value of long datatype and i want to convert it into integer datatype value
    null

    It would have helped if you could have posted sample data.
    now my requirement is to calculate the difference in hours between the start time and end time.Assuming you want the difference in time irrespective of the dates and the time is stored like HH24:MI:SS format, you could try something like:
    SQL> WITH test_tab AS
      2       (SELECT '09:12:33' start_time, '12:30:33' end_time
      3          FROM DUAL
      4        UNION ALL
      5        SELECT '09:12:33' start_time, '14:12:33' end_time
      6          FROM DUAL)
      7        -- end of test data
      8  SELECT end_time, start_time,
      9         TRUNC (  (  TO_DATE (end_time, 'HH24:MI:SS')
    10                   - TO_DATE (start_time, 'HH24:MI:SS')
    11                  )
    12                * 24
    13               ) diff_in_hours
    14    FROM test_tab
    15  /
    END_TIME START_TI DIFF_IN_HOURS
    12:30:33 09:12:33             3
    14:12:33 09:12:33             5
    2 rows selected.Hope this helps,
    Regards,
    Jo

  • Desperate for a little help with VMware Fusion tools

    I tried the Fusion discussions group on this question but got nothing, so please don't tell me to try there; I already have.
    I am using VMare Fusion 2.0.6 on my MacBook running 10.6.4; Windows OS is XP Home edition, SP3
    I find more and more applications that previously did not work well in OSX are now running nicely on my MacBook (i.e., various applications from Garmin) and that I rarely boot up in Windows.
    However, not long ago I did boot up in Windows and saw the alert, “VMware tools is out of date. Choose the virtual Machine > Install VMwre Toold Menu.” I did so and it failed, miserably. I lost tools completely, everything was a bloody mess.
    I looked for help/a solution on the VMware site, found it, but it was beyond my capability. I simply could not figure out how to do what it was directing me to do.
    I moved my Virtual Machine folder from a backup of my MacBook back to the MacBook; I am back to a point where all is well but I am also, naturally, getting the “VMware tools is out of date. Choose the virtual Machine . Install VMwre Toold Menu.”
    When I choose "Virtual Machine . Install VMwre Toold Menu", I get this alert: You cannot install the VMware Tools package until the guest operating system is running. If your guest operating system is not running, choose cancel and install the VMware Tools Package later.
    Isn't the "guest operating system" OSX on my MacBook? Well of course it's running; how the heck could you be running Fusion if OSX isn't running? There must be something here I just don't understand.
    Does some kind soul have the time and patience to explain to me what I am obviously missing here so I can get on with it and update VMware Tools?
    Many, many thanks if someone can

    OK, here's the rest of the story.
    I followed the above instructions, sort of...
    Removed Tools as directed.
    A restart was required to finish the removal.
    Restarted, went to Virtual Machine > Install VMware Tools package and got the, for me, dreaded - Warning, you cannot install the VMware Tools package unless the guest operating system is running, etc., so I clicked on Cancel.
    I also got the Found New Hardware Wizard, which I cancelled out of.
    I went to Virtual Machine > CD/DVD > Choose a disk image and navigated to "/Library/Application Support/VMware Fusion/isoimages/windows.iso" as I was directed, clicked on Open, and nothing happened.
    In Windows, I then went to the CD/DVD drive, to run the setup.exe manually.
    Among the choices there I found both VMware Tools and VMware Tools 64 and forgot I was told to run setup.exe. I asked again and was told to run VMware Tools. I did so and that fixed it.
    Later, I was told that I should have chosen setup.exe NOT the VMware Tools.msi, but that since setup.exe calls the VMware Tools.msi it's probably a moot issue as long as I received a message that VMware Tools were successfully installed.
    So, I guess the correct thing would have been to run setup.exe, but running VMware Tools also did the trick.
    Hope this helps someone else out if they stumble across it.

  • Hoping for a little help with registering and hosting questions.

    i was hoping i could get some information from some of you
    that have personal experience with registering your site and
    picking a hosting provider.
    im wondering what the difference is between say....Dot5
    hosting at 5.00 a month and .. network solutions at 29.99 a month?
    my local provider here in sacramento wants 30 a month as
    well......299.oo a yr.
    should I go with a local provider? or go with ... say GoDaddy
    or some other company?
    also, registering. Im about to register my site name.
    however, some companies include it in the "packages" they offer.
    should I register it myself or let the hosting company I choose do
    it?
    sorry for the newb questions....but I cant find any good info
    on this and I was hoping maybe some of you that have already done
    this to chime in.
    thanks in advance.

    If you want almost all of the below features for about $9.00
    a month go to
    Gate.com and pick your package. I use them for several web
    sites and have
    never been dissatisfied with their services or features.
    They will register your domain and I've done it both ways,
    but have never
    had problems with them but it does make a lot of sense to
    register it
    yourself and keep full ownership....
    "Sonjay" <[email protected]> wrote in message
    news:C19368C5.A15FD%[email protected]...
    > There's probably not a dime's worth of difference
    between the Dot5 hosting
    > and the NetSol hosting, but I wouldn't recommend either
    of those companies
    > for hosting.
    >
    > $30/month seems high unless you have very specific needs
    -- there's plenty
    > of good hosting around for $8 or $10 a month. The thing
    you need to do is
    > decide what your requirements are: php? asp? MySQL?
    Access? dot.net?
    > E-mail?
    > Telnet or SSH access? Do you need/want a control panel
    that makes it easy
    > for you set up your own e-mail accounts, password
    protect directories, and
    > that sort of thing, or will basic FTP access be all you
    need? Do you want
    > a
    > statistics package included with your hosting? Do you
    need to run more
    > than
    > one domain under the same account? If all of the above
    makes you shake
    > your
    > head and say "I don't need any of that," then you can
    probably manage just
    > fine with any of the $5-$10 month basic packages, with a
    reputable host.
    >
    > Whatever you do, register your domain separately from
    your hosting, and
    > only
    > use an ICANN-accredited registrar, none of those
    resellers that tend to
    > disappear and/or register people's domains in their own
    name. I have
    > nothing
    > good to say about NetSol as a registrar, going back to
    the years when they
    > were the only game in town, and I will never use them
    again, but any other
    > ICANN-accredited registrar should do you just fine.
    >
    > --
    > Sonjay
    >
    > On 11/29/06 3:51 PM, "Progressive_Learning" wrote:
    >
    >>
    >>
    >> i was hoping i could get some information from some
    of you that have
    >> personal
    >> experience with registering your site and picking a
    hosting provider.
    >>
    >> im wondering what the difference is between
    say....Dot5 hosting at 5.00 a
    >> month and .. network solutions at 29.99 a month?
    >>
    >> my local provider here in sacramento wants 30 a
    month as well......299.oo
    >> a
    >> yr.
    >>
    >> should I go with a local provider? or go with ...
    say GoDaddy or some
    >> other
    >> company?
    >>
    >> also, registering. Im about to register my site
    name. however, some
    >> companies include it in the "packages" they offer.
    should I register it
    >> myself
    >> or let the hosting company I choose do it?
    >>
    >> sorry for the newb questions....but I cant find any
    good info on this and
    >> I
    >> was hoping maybe some of you that have already done
    this to chime in.
    >>
    >> thanks in advance.
    >>
    >
    >

  • SQL syntax for querying Active Directory group membership

    Post Author: cantrejj
    CA Forum: Data Connectivity and SQL
    I've established a connection to Active Directory through Crystal Reports XI. Now I need to write an SQL select statement to return all computer accounts and their group memberships. My statement returns all the computer accounts in the target OU, but when I add the memberOf field to my report everything goes blank. What am I doing wrong? I've included below my query statement and would welcome any suggestions...******************************************Select CN, memberOfFrom 'LDAP://OU=Managed Accounts, OU=Central Valley Service Area, DC= root, DC=sutterhealth, DC=org'where ObjectClass='computer'********************************************

    No ERRORs, no PANICs:
    # grep -i error /var/log/samba/log.smbd
    # grep -i panic /var/log/samba/log.smbd
    # grep -i error /var/log/samba/log.smbd.old
    # grep -i panic /var/log/samba/log.smbd.old
    #

  • Solaris 11 AI xml syntax for install service help

    Hi,
    I try to set the quota on all the zfs file system with Solaris 11 AI,
    here is the line:
    <filesystem name="data" mountpoint="/data"/>
    what is the syntax to set the quota?
    Thanks!

    The ai_manifest man page shows examples of setting ZFS properties, you'd do something like the below to set the quota to 10 GB.:
    <filesystem name="data" mountpoint="/data">
                 <options>
                   <option name="quota" value="10gb"/>
                 <options>
               </filesystem>

  • Oracle access sql syntax

    Hi,
    I am migrating access database to oracle 9i. Do you know of any changes to access sql syntax for it to use oracle backend?

    Very general question. It of course depends on the SQL you use. They are not 100% compatibile. The workbench will create the necessary link tables on your behalf, but you may need to update the SQL in you Access application code. Also you might have to tune your access application to work better in a client/server mode, e.g. if you where doing a join of two tables you would want that to occur on the server not on the client. This depends how you interface/bypass the jet engine. These issues are common whether the backend is Oracle or SQL Server for that matter.
    This should become obvious during your testing.
    Donal

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

Maybe you are looking for