Query with numbers from T1 to Tmax (1 Viewer)

btamsgn

Member
Local time
Today, 11:49
Joined
Nov 8, 2010
Messages
51
Dear Friends,
I want to create a query with numbers from T1 to Tmax in file quiluat.accdb like file book excel
Please find the attachment for your refference.
Looking forwarding to supporting and receiving from your responses.
 

Attachments

  • Max T2.zip
    31.2 KB · Views: 192

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 23:49
Joined
Feb 28, 2001
Messages
27,321
What are you saying is wrong? Describe your problem in words. Don't tell us "make query look like spreadsheet" because Access isn't Excel. They do different things. Based on the query in the .ACCDB, I would say that there is a structural (or structural concept) issue in the table. What is the goal in words?
 

SHANEMAC51

Active member
Local time
Today, 07:49
Joined
Jan 28, 2022
Messages
310
Please find the attachment for your refference
renamed RAR archive

NgayTmaxT1T2T3T4NgayT1T2T3T4
10-окт-2163221310-окт-213252629
13-окт-212320143210-окт-214262730
15-окт-215584310-окт-215272831
17-окт-219489110-окт-216282932
20-окт-2155424713-окт-2120343739
22-окт-215321313-окт-2121353840
24-окт-2176232113-окт-2122363941
27-окт-21191349313-окт-2123374042
14-ноя-21532131015-окт-215131720
17-ноя-2114411101etc
19-ноя-211191162
21-ноя-2111111711
24-ноя-21112885
26-ноя-211541474
28-ноя-212113491
09-фев-223317710
11-фев-2211101819
13-фев-221414712
16-фев-2252338
18-фев-221231166
20-фев-225421014
 

June7

AWF VIP
Local time
Yesterday, 20:49
Joined
Mar 9, 2014
Messages
5,493
I very much doubt this can be done with SQL alone and will require VBA writing records to a temp table.

I can't open RAR or WinZip files, only Windows Compression zip.
 

btamsgn

Member
Local time
Today, 11:49
Joined
Nov 8, 2010
Messages
51
Dear All,

File has updated with program "Windows compressed" already
Pls open again, is it ok?
Pls view and advise, thanks.
 

GPGeorge

George Hepworth
Local time
Yesterday, 21:49
Joined
Nov 25, 2004
Messages
1,992
As a general rule, if you want to create Excel spreadsheets, the proper tool is the Excel application.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:49
Joined
May 7, 2009
Messages
19,246
How did you get TMax value? what is the secret herbal formula?
 

Mike Krailo

Well-known member
Local time
Today, 00:49
Joined
Mar 28, 2020
Messages
1,044
Am I missing something here? Wouldn't you just select the data you want and order by Tmax field? Or are you asking something different. Since you never really describe what you are trying to do, we are left to guess what your thinking. T1 to Tmax looking at that spreadsheet doesn't make sense since they are in different columns. Just describe in words what you are trying to accomplish.
 

June7

AWF VIP
Local time
Yesterday, 20:49
Joined
Mar 9, 2014
Messages
5,493
Zip folder now opens. But already saw data in @SHANEMAC51 post. My comment is unchanged. Consider:
Code:
Sub CalcT()
Dim db As DAO.Database, rs As DAO.Recordset
Dim n As Integer, j As Integer, w As Integer, x As Integer, y As Integer, z As Integer
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Table1 ORDER BY NGay")
CurrentDb.Execute "DELETE FROM Table2"
Set db = CurrentDb
Do While Not rs.EOF
    n = rs!T1
    j = 0
    Do While n <= rs!TMax
        w = rs!T1 + j
        x = rs!T1 + rs!T2 + j
        y = rs!T1 + rs!T2 + rs!T3 + j
        z = rs!T1 + rs!T2 + rs!T3 + rs!T3 + j
        db.Execute "INSERT INTO Table2(Ngay, T1,T2,T3,T4) VALUES(#" & rs!Ngay & "#," & w & "," & x & "," & y & "," & z & ")"
        n = n + 1
        j = j + 1
    Loop
    rs.MoveNext
Loop
End Sub
 

Users who are viewing this thread

Top Bottom