What is the first code: "0" will be deleted automatically?

SELECT (DBO.ORDER_D [CUSNO], [SCHEDULENO] = [_ THISROW]. [SCHEDULENO], TRUE)

May I ask the return value of the above formula: if it is โ€œ0123โ€
But the first code โ€œ0โ€ will be deleted automatically
Only returns โ€œ123โ€
How can I solve it?
Thank you

0 11 319
11 REPLIES 11

I think you have to change the column format to Number

If you want to save the value with the leading zero, you need to use column type as โ€œplain textโ€ with your spreadsheet. โ€œAutomaticโ€ or โ€œNumberโ€ type will filter the zero away when saving the value to your data base.

I have set it to โ€œTextโ€ in the โ€œTypeโ€ type in APPSHEET

But still not work

Another database source is โ€œMS SQL SERVERโ€ and its Type is set to โ€œVARCHAR (4)โ€

Is this โ€œBugโ€?

Thank you

Steve
Platinum 4
Platinum 4

Please post a screenshot demonstrating the problem.

I am elaborating on my question

  1. The database that I set is โ€œMS SQL SERVERโ€, not GOOGLE SHEET

  2. There is a CUSTOMER database in MS SQL SERVER
    Its structure is:
    CREATE TABLE dbo.CUSTOMER
    (
    CUSNO VARCHAR (5) NOT NULL,
    CUSNAME VARCHAR (100) NULL,
    SCHEDULENO VARCHAR (50) NULL,
    PRIMARY KEY (CUSNO)
    )
    END
    Its information is: 0234 CNAME1
    0678 CNAME2
    0012 CNAME3

  3. In APPSHEET, there are three fields of CUSNO and CUSNAME, SCHEDULENO
    Its โ€œTypeโ€ is โ€œTextโ€

  4. The โ€œINITIAL VALUEโ€ in the CUSNO field in APPSHEET is set to:
    SELECT (DBO.ORDER_D [CUSNO], [SCHEDULENO] = [_ THISROW]. [SCHEDULENO], TRUE)

  5. Enter 0234 in the SCHEDULENO field
    Normal in CUSNO should display: 0234
    But it does show: 234

  6. Is it APPSHEET BUG?

Thank you

Please post a screenshot demonstrating the problem.

Please also post screenshots of the CUSNO and SCHEDULENO columns in AppSheet.

Source is โ€œms sql serverโ€
Directly connect to the database and then browse the database directly
, Where the red box is marked:
cusno: 133, the correct value should be: 0133
ordseq: 2, the correct should be: 02
itemno: 133223, the correct value should be: 0133223
Ask the teacher for help
Thank you

AppSheet does not modify Text values upon display, so I would have to assume the value being provided by your database also does not have the leading zero. Can you provide a screenshot of an SQL statement and output showing the stored values?

Ask the teacher
As shown in the red line of the attachment: datasource: google
And the blue line: database-1: google

I remember that when I first started, I was transferred from the specified โ€œms sql serverโ€ source?

I do nโ€™t know when it will become a datasource: google

Or did I accidentally press that setting there?

Is there any relevant documentation for this part of the operation?

Thank you

Please contact support@appsheet.com for further help.

Thank you very much teacher

Top Labels in this Space