Make table fit within 1 column (2-column environment) - multiple-columns

I am trying to fit this table within a two column environment, but only in one column. Now it is floating over the second column. I think I should either make the column width smaller or rescale the table. Could someone help me with this problem? Thanks in advance.
\documentclass[twoside,twocolumn,9pt]{article}
\begin{document}
\begin{table}[!h]
\small
\caption{Caption text.}
\label{table1}
\begin{tabular*}{0.9\textwidth}{#{\extracolsep{\fill}}l|cccccc}
\hline
\textbf{C1} & \textbf{Column 2(M)} & \textbf{Column 3(M)} & \textbf{$N_{\text{Column}}$} & \textbf{$N_{\text{Bla}}$} & \textbf{$N_{\text{Bla/ Bla}}$} & \textbf{$N_{\text{Column}}$} \\
\hline
BLA & 1.0 & 1:6 & 78 & 468 & -- & 546 \\
& 3.0 & 1:2 & 183 & 366 & -- & 549 \\
\hline
BLA & 1.0 & 1:1.2:2.2 & 125 & 150 & 275 & 550 \\
& 1.2 & 1:1.2:1.6 & 145 & 174 & 232 & 551 \\
& 1.5 & 1:1.2:1.2 & 172 & 172 & 206 & 550 \\
& 2.0 & 1:0.7:0.9 & 212 & 148 & 191 & 551 \\
& 3.0 & 1:0.5:0.6 & 262 & 131 & 157 & 550 \\
\hline
Bla & 1.0 & 1:1.2:2.4 & 120 & 144 & 288 & 552 \\
& 1.2 & 1:1.2:1.8 & 138 & 166 & 288 & 552 \\
& 1.5 & 1:1.2:1.4 & 162 & 162 & 227 & 551 \\
& 2.0 & 1:0.8:1.0 & 196 & 157 & 196 & 549 \\
& 3.0 & 1:0.5:0.7 & 250 & 125 & 175 & 550 \\
\hline
\end{tabular*}
\end{table}
\end{document}
John

Related

Sorting my spacing from copying listbox data

I am using the below code to copy data from a listbox:
Dim sData As String
Dim X As Integer
'Has the user ticked the use col heads tick box?
If Me.ChkColHeads = True Then
sData = sData & "Account Number" & vbTab & "Advisor Name" & vbTab & vbTab & "Team" & vbTab & vbTab & vbTab & vbTab & vbTab & "Days Lost" & vbTab & vbTab & vbCrLf
End If
'x would be set to row 1 if using column heading in list
For X = 0 To Me.List31.ListCount
If Me.List31.Selected(X) = True Then
sData = sData & Me.List31.Column(0, X) & vbTab & vbTab & Me.List31.Column(1, X) & vbTab & vbTab & Me.List31.Column(2, X) & vbTab & vbTab & Me.List31.Column(3, X) & vbTab & vbTab & Me.List31.Column(4, X) & vbCrLf
End If
Next
'Copy the data to the clipboard
ClipBoard_SetData (sData)
'Let user know that the procedure has been completed
MsgBox "Data copied to clipboard", vbInformation + vbOKOnly, "Copied"
There is also a module that copies it to the clipboard.
My issue it the formatting - Some items are not lined up as they should be as below:
11111 Name1 Team1 0
22222 Name1 Team2
33333 Name1 Team3 5
22222 Name1 Team1 6
1121 Name1 Team3 0
543 Name1 Team3
7654 Name1 Team4
432543 Name1 Team7 0
87654 Name1 Team1 3
Some teams are not lined up and can not figure out why. Any help is appreciated
It's because you use vbTab. But that is correct if you wish to paste the date into, say, Excel.
If you wish text and spaces only, do:
Left(Me.List31.Column(0, X) & Space(16), 20)
or similar. Adjust 16 and 20 to your liking.

Too few parameters, expected 4;

Dim query As String
query = "insert into tbl_passenger(passenger_name,age,gender_id,address,phone_no,plane_no,seat_no,destination_id,time_id,price_id)values('" & _
Me.txtpassengername.Value & "'," & Me.txtage.Value & "," & Me.cmbgender.Column(1) & ",'" & Me.txtaddress.Value & "', " & Me.txtphone.Value & "," & _
Me.cmbplane.Column(1) & "," & Me.cmbseat.Column(1) & "," & Me.cmbdestination.Column(1) & "," & Me.cmbtime.Column(1) & "," & _
Me.cmbprice.Column(1) & ")"
CurrentDb.Execute (query)
MsgBox ("Data Inserted")
What is the problem here? The error I get is
Too few parameters, expected 4;
Insert a debug line:
Debug.Print query
CurrentDb.Execute (query)
MsgBox ("Data Inserted")
Study what you see, and you will know. Or post the output here.

vba convert msexcel table to json. Ending line not consistant

The sub below creates a json file from an Excel table that starts in cells(1,1). The problem is when I drag and drop the generated file in Visual Studio, I get the following message:
The line endings in the following file are not consistent. Do you want
normalize the line endings?
How can I make this sub produce consistent line endings?
Sub CreateWksJON(mywksht As Worksheet, NbofFields As Integer, NbofElements As Integer)
Dim FilePath As String
Dim fieldData As String
Dim i As Integer
Dim j As Integer
Dim objStream
Set objStream = CreateObject("ADODB.Stream")
objStream.Charset = "utf-8"
objStream.Open
FilePath = "E:\Git\ACWB-MSEcelWorksheetTOJson\" & mywksht.Name & ".json"
'Open FilePath For Output As #1
fieldData = "{" & Chr(10) & Chr(13) & """" & mywksht.Name & """" & ": {" & Chr(10) & Chr(13)
objStream.writetext fieldData
fieldData = ""
For j = 1 To NbofFields
i = 1
fieldData = """" & mywksht.Cells(i, j).Value & """" & ": ["
For i = 2 To NbofElements - 2
If IsNumeric(mywksht.Cells(i, j).Value) Then
fieldData = fieldData & mywksht.Cells(i, j).Value & ","
Else
fieldData = fieldData & """" & mywksht.Cells(i, j).Value & """" & ","
End If
Next i
'add the last element of the field
If IsNumeric(mywksht.Cells(i + 1, j).Value) Then
fieldData = fieldData & mywksht.Cells(i + 1, j).Value
Else
fieldData = fieldData & """" & mywksht.Cells(i + 1, j).Value & """"
End If
If j = NbofFields Then
fieldData = fieldData & "]" & Chr(10) & Chr(13)
Else
fieldData = fieldData & "]," & Chr(10) & Chr(13)
End If
objStream.writetext fieldData
Next j
objStream.writetext "}" & Chr(10) & Chr(13) & "}" & Chr(10) & Chr(13)
objStream.SaveToFile FilePath, 2
End Sub
Here is the table
Envelpope_ID CG_MAC CG_Imp CG_SI Weight_Imp Weight_SI
1 20 875 22.225 71700 32522.58942
1 20 875 22.225 98000 44452.0748
1 28 900 22.86 129720 58840.03207
1 38 1000 25.4 129720 58840.03207
1 38 1000 25.4 119840 54358.53718
1 43 1200 30.48 102200 46357.16372
1 43 1200 30.48 94000 42637.7044
1 34 950 24.13 71700 32522.58942
1 20 875 22.225 71700 32522.58942
2 20 875 22.225 71700 32522.58942
2 20 875 22.225 98000 44452.0748
2 28 900 22.86 125000 56699.075
2 38 1000 25.4 125000 56699.075
2 38 1200 30.48 102200 46357.16372
2 43 1200 30.48 94000 42637.7044
2 43 950 24.13 71700 32522.58942
2 34 875 22.225 71700 32522.58942
You could change to VbCrLf, but character naming should work if you do it in the right order.
Cr is ASCII(13) and Lf is ASCII(10) so your line ending should be
chr(13)&chr(10)

updating day by day data in database using pentaho spoon

I have a SQL query as mentioned below and this will update DB every day comparing the date (latest appended date data will be updated in DB) and I want to do this in transformations using Pentaho Data Integration (Kettle).
Do While i < dgTest.RowCount
dd = Mid(dgTest.Item(2, i).Value, 5, 2) & "/" & Mid(dgTest.Item(2, i).Value, 7, 2) & "/" & Mid(dgTest.Item(2, i).Value, 1, 4)
Sql = "INSERT INTO cash ([comp], strno, bday, openread, curread,refqty,refamt, promoq," & _
" promoa, netsprod, netsnprod, eatintc, eatins, eatouttc, eatouts, " & _
" dttc, coffeetc, dts, coffeesales, csh, cover,recamt,crsalesamt ) Values " & _
" ('" & dgTest.Item(0, i).Value.ToString & "','" & dgTest.Item(1, i).Value.ToString & _
"',#" & CDate(dd) & "#,'" & dgTest.Item(3, i).Value.ToString & "'," & dgTest.Item(4, i).Value & "," & _
dgTest.Item(5, i).Value & "," & dgTest.Item(6, i).Value & _
"," & dgTest.Item(7, i).Value & _
"," & dgTest.Item(8, i).Value & "," & dgTest.Item(9, i).Value & _
"," & dgTest.Item(10, i).Value & "," & dgTest.Item(11, i).Value & _
"," & dgTest.Item(12, i).Value & "," & dgTest.Item(13, i).Value & "," & dgTest.Item(14, i).Value & _
"," & dgTest.Item(15, i).Value & "," & dgTest.Item(16, i).Value & "," & dgTest.Item(17, i).Value & "," & dgTest.Item(18, i).Value & "," & dgTest.Item(19, i).Value & "," & dgTest.Item(20, i).Value & "," & dgTest.Item(21, i).Value & "," & dgTest.Item(22, i).Value & ")"
cmd = New OleDbCommand(Sql, con)
cmd.ExecuteNonQuery()
i = i + 1
Loop
I don't understand the approach you are trying to implement but what you can do is from input table step read the data, use modified java-script and specify that on this particular time update the database.. example
var d = new Date();
var hour1 = d.getHours();
if(hour1==14)
{
if(d.getDate()==day2 && month1==month2 && year1==year2 && hour>=13 && hour<17)
}

number of query values and destination fields are not the same

This is what I have for the Add Event.
CurrentDb.Execute "INSERT INTO tblMatchBook ([Patron], [Staff], [TimeReceived], [SurveyLink], [DateFinished], [BookTitles]) " & _
" Values('" & Me.ddBarcode & "," & Me.ddStaff & "," & Me.txtRDate & "," & Me.txtLink & "," & "" & "," & "" & "')"
I cannot figure out what is wrong.
insert into Main values (28494,1,False,'Buto-asma Sirop' , 'Buto-asma Sirop', 3.99 , 'Syrup', 'ispani', ' ', ' ',0, '1',4988 )