Forum Discussion

Analitika's avatar
Analitika
Post Prodigy
6 years ago
Solved

M change types

I have code

 

(strSource, Ip , Port , dBase ) =>

let
Lent = "da",
Source = Sybase.Database(Ip & ":" & Port, dBase),
DBA_view_DidknObj = Source{[Schema="DBA",Item=Lent]}[Data]
in
DBA_view_DidknObj

 

but got error 

 

An error occurred in the ‘’ query. Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&

 

how to convert number to text?

3 Replies

  • Analitika 

    Try

    (strSource, Ip , Port , dBase ) =>
    
    let
    Lent = "da",
    Source = Sybase.Database( Text.From(Ip) & ":" &  Text.From(Port), dBase),
    DBA_view_DidknObj = Source{[Schema="DBA",Item=Lent]}[Data]
    in
    DBA_view_DidknObj

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube, LinkedIn

  • Analitika , Try like

    let
    Lent = "da",
    Source = Sybase.Database(Ip & ":" & Number.ToText(Port), dBase),
    DBA_view_DidknObj = Source{[Schema="DBA",Item=Lent]}[Data]
    in
    DBA_view_DidknObj