User Profile

Collapse

Profile Sidebar

Collapse
Microblitz
Microblitz
Last Activity: May 17 '13, 02:28 PM
Joined: Jul 2 '10
Location: Devon,UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I finally got around this by not trying to be too clever and using the multi-select parameters instead of coding my own method for it.
    See more | Go to post

    Leave a comment:


  • I rewrote this and solved it.
    See more | Go to post

    Leave a comment:


  • Microblitz
    started a topic Order of precedence and Logical operators

    Order of precedence and Logical operators

    So here is my dilemma.
    This code that I have written produces three options
    The first is a VB calender start date and end date for filtering.

    The second is a dynamically filled drop down which selects the department or defaults to all departments.

    The second is a dynamically filled drop down which defaults to add 'Cells' which is just a two letter code.

    To create the default the <All...
    See more | Go to post

  • Microblitz
    started a topic select unique and return related table

    select unique and return related table

    This Code selects a unique entry of the Manufacturing Order.

    Code:
    DECLARE @suffix NVARCHAR(8)
    DECLARE @DateStart NVARCHAR(12)
    DECLARE @DateEnd NVARCHAR(12)
    
    SET @suffix = '/M'
    SET @DateStart = '01/05/2013'
    SET @DateEnd = '08/05/2013'
    
    SELECT a.*  from  ManufacturingOrders a 
    INNER JOIN
    (SELECT DISTINCT  ManufacturingOrderId FROM ManufacturingOrders) AS b
    ON a.ManufacturingOrderId
    ...
    See more | Go to post

  • Microblitz
    replied to Related tables and opening forms
    If im not allowed yo dub it primitive I find vba ... Quaint.

    Ok ill look into openArgs.
    See more | Go to post

    Leave a comment:


  • Microblitz
    replied to Related tables and opening forms
    Ok ill accept that access is that primitive.

    got an example i can mash?
    See more | Go to post

    Leave a comment:


  • Microblitz
    started a topic Related tables and opening forms

    Related tables and opening forms

    I have 3 tables related as follows

    Requests,-<, Job -< Tool

    One request has many Jobs and each Job has many tools.

    I want to open Request, enter data then hit a button which closes that window

    ... and opens the Job window on the related record.
    Hit a button which closes that window

    ...and opens a Tool form
    Which allows data entry
    and gives the...
    See more | Go to post

  • Microblitz
    replied to C#+SQL processing reserved characters
    Youre right. Simply adding a space at the end of each line in the text file allowed the file to process properly.

    Thank you.
    See more | Go to post

    Leave a comment:


  • Microblitz
    replied to C#+SQL processing reserved characters
    Ok to find exactly what line number it faults in i removed the try catch and allowed it to exception.

    It faults at line 43 with reader = SQLcmd.ExecuteR eader(); with the error "Incorrect syntax near the keyword like"

    SQLcmd at this point is select ItemDescription from PurchaseOrderIt ems where ItemDescription like 'z%'

    Hope this helps
    See more | Go to post

    Leave a comment:


  • Microblitz
    replied to C#+SQL processing reserved characters
    ... The catch at line number 63...

    The string physically looks like the text document version.
    If I copy paste that into SQL management and execute it it works perfectly.

    For instance, if I change the dbtext.txt file to say 'select * from inventory' it works fine. So the code is concrete, but I think the syntax error being detected by the SQLcommand is the apostrophe at the beggining of '%z'.
    See more | Go to post

    Leave a comment:


  • Microblitz
    replied to C#+SQL processing reserved characters
    It's being caught by the try catch exception. It doesn't report a line number but it should be the catch at 63 thats preventing an exception. The returned error string is "inccorect syntax near the keyword 'like'".

    This program will happily process code which doesnt have reserved characters in it so I know the code works fine and if I manually create a string with the code in it it will process. It seems only an issue if...
    See more | Go to post

    Leave a comment:


  • Microblitz
    started a topic C#+SQL processing reserved characters

    C#+SQL processing reserved characters

    I've written a program that loads in a text SQL file of commands Processes it and displays the result.

    To test it I wrote a simple top 10 query which worked perfectly. Then I thought I'd like to test other scripts so in my text document I created:

    select ItemDescription from PurchaseOrderIt ems
    where ItemDescription like 'z%'


    At which point my code balked at the like and whined about a syntax error...
    See more | Go to post

  • visual studio.
    See more | Go to post

    Leave a comment:


  • Where do you suggest?

    Visual Basic?
    VBS
    SQL
    Microsoft SQL Report services
    Visual studio
    See more | Go to post

    Leave a comment:


  • Microblitz
    started a topic Ho to hide a row(s) using a radio button?

    Ho to hide a row(s) using a radio button?

    I need to create a completely different form layout depending on the setting of a boolean switch (Radio button) on a form.

    I have added a boolean radio button to the layout called AltForm and I was going to use the visibility property to hide or show the rows as I would do in vidual basic. Only I can't seem to figure out how to change the property. The parameter textboxt10.visi ble does nothing except cause a syntax error.
    I...
    See more | Go to post

  • How to print out all accounts and the groups/permissions they have.

    I have to do a security audit for a a server 2003/8.

    How do I print out all accounts and the groups/permissions they have on a per user basis?

    Is there some kind of script in existance for this?
    See more | Go to post

  • The alternative code using the technique as explained above by ck9663 for comparison.
    Code:
    DECLARE @Classification bigint
    SET @Classification = (SELECT Classification FROM Classifications WHERE Classifications.ClassificationId  = 'STOCKITEM')
    
    select * from  
    ( 
    	select 
    		Dtbl.SalesYear
    		Dtbl.SalesMonth,
    		Dtbl.ProductId,
    		row_number() over (partition by SalesYear,SalesMonth
    ...
    See more | Go to post
    Last edited by Microblitz; Sep 24 '10, 07:42 AM. Reason: Uphold the law

    Leave a comment:


  • This is the final version I added to the code. It's not the same method as the suggestion above but I managed to get that way working after I got the report to function properly. If I can find the method detailed here I will post it for comparison - Microblitz
    Code:
    DECLARE @Classification bigint
    DECLARE @StartDate smalldatetime
    DECLARE @EndDate smalldatetime
    DECLARE @MonthEndDate smalldatetime
    DECLARE @TempDate
    ...
    See more | Go to post
    Last edited by Microblitz; Sep 24 '10, 07:34 AM. Reason: To protect the innocent

    Leave a comment:


  • Yes that makes a lot more sense as soon as you mentioned the "AS" keyword.

    The "z" routeine I can leave as is, but the 'q' query needs to specify the particulatr brand of product from a related search.

    This is the relationship that needs to be parsed
    Code:
    FROM ManufacturingOrders 
      
    INNER JOIN Products ON ManufacturingOrders.Product = Products.Product 
    INNER JOIN Classifications
    ...
    See more | Go to post

    Leave a comment:


  • Well I do now, though my guess work was reasonably accurate. It provides a seconed layer of filtering to the original query.
    I guess the two levels of sub query is the (sub query here) and the final line in the original example.
    "where rank <= 4 "
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...