User Profile

Collapse

Profile Sidebar

Collapse
glennyboy
glennyboy
Last Activity: Nov 4 '14, 01:00 AM
Joined: Oct 7 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • glennyboy
    replied to Same Column, Same Table - Query
    thanks a lot Rabbit.
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    here is my revised code, but im unable to separate column of sales code and unit price

    Code:
    SELECT
    	[SSI$Sales Price].[Sales Code]
        ,[SSI$Sales Price].[Item No_]
        ,[SSI$Sales Price].[Variant Code]
        ,[SSI$Sales Price].[Unit of Measure Code]
        ,[SSI$Sales Price].[Unit Price]
        ,SSI$Item.[Unit Cost]
        ,[SSI$Sales Price].[Starting Date]
        ,[SSI$Sales Price].[Ending Date]
    ...
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    Rabbit,

    thanks for the reply.

    i want to separate the column of [SSI$Sales Price].[Sales Code] into C00020 and SRP in the same table.

    thanks.
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    here is revised query:

    Code:
    SELECT
    	[SSI$Sales Price].[Sales Code] AS CUSTOMER
    	,[SSI$Sales Price].[Sales Code] AS SRP
    	,[SSI$Sales Price].[Item No_] AS [Item No]
    	,[SSI$Sales Price].[Variant Code]
    	,[SSI$Sales Price].[Unit of Measure Code] AS [Unit of Measure]
    	,[SSI$Sales Price].[Unit Price] AS SALES1
    	,[SSI$Sales Price].[Unit Price] AS SALES2
    	,SSI$Item.[Unit Cost]
    	,[SSI$Sales
    ...
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    error message

    Msg 1013, Level 16, State 1, Line 3
    The objects "SSI$Sales Price" and "SSI$Sales Price" in the FROM clause have the same exposed names. Use correlation names to distinguish them.
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    here is my query code
    Code:
    USE [SSI-HQ]
    
    SELECT
    	[SSI$Sales Price].[Sales Code]
    	,[SSI$Sales Price].[Item No_] AS [Item No]
    	,[SSI$Sales Price].[Variant Code]
    	,[SSI$Sales Price].[Unit of Measure Code] AS [Unit of Measure]
    	,[SSI$Sales Price].[Unit Price] AS SALES1
    	,[SSI$Sales Price].[Unit Price] AS SALES2
    	,SSI$Item.[Unit Cost]
    	,[SSI$Sales Price].[Starting Date]
    	,[SSI$Sales
    ...
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    ck9663,

    thanks for the reply.

    its only 1 table.
    See more | Go to post

    Leave a comment:


  • glennyboy
    replied to Same Column, Same Table - Query
    Frinavale,

    thank you for the reply.

    - This is for MS SQL Server.
    - Im using SQL Server Management Studio Express to test the sql query, then i will use it in MS Excel to export data from sql server to MS Excel.
    See more | Go to post

    Leave a comment:


  • glennyboy
    started a topic Same Column, Same Table - Query

    Same Column, Same Table - Query

    good day.


    sample database:

    table1

    col1 col2 col3
    A item1 100
    A item2 200
    A item3 300
    B item1 400
    B item2 500
    B item3 600


    ############### ############### ###

    query result:

    col1 col2 col3 col4 col5
    item1 A 100 B 400...
    See more | Go to post
No activity results to display
Show More
Working...