我正在使用 MS Access 2016,我有一个访客表、一个研讨会表和一个链接参加表。我想查询这个表并得到一个数字矩阵,显示每个数字之间的关系......
我使用的是 MS Access 2016,我有一张访客表、一张研讨会表和一张链接出席表。我想查询这些表,并得到一个数字矩阵,以双向表格的形式显示每个表之间的关系。我想要的数字是它们有多少个共同的研讨会。
我想要实现的目标的例子
我已经使用 vba 和一些糟糕的报告结构完成了此操作...现在用户想要过滤和更改内容。我希望可以将其作为查询来执行。我是 SQL 新手,所以希望有人可以在这里为我指明正确的方向。使用交叉表查询是否可行?我似乎找不到我需要的示例。
我迄今为止的尝试却很遗憾地失败了。
转换 Count(tblAttending.WorkshopID) 作为 CountOfWorkshopIDSELECT tblAttending.VisitorID,tblVisitors2.NameFROM tblAttending INNER JOIN tblVisitors2 ON tblAttending.VisitorID = tblVisitors2.VisitorIDGROUP BY tblAttending.VisitorID,tblVisitors2.NamePIVOT tblAttending.VisitorID;
最终,我决定这么做...
TRANSFORM nz(Sum(visitingpairs.CommonWorkshop))+0 AS SumOfCommonWorkshopSELECT visitingpairs.VisitorName1FROM (SELECT V1.VisitorID AS VisitorID1, V1.Name AS VisitorName1, V2.VisitorID AS VisitorID2, V2.Name AS VisitorName2, Nz(Count(A.WorkshopID),0) AS CommonWorkshopFROM (tblAttending AS A INNER JOIN tblVisitors AS V1 ON A.VisitorID = V1.VisitorID) INNER JOIN (tblAttending AS B INNER JOIN tblVisitors AS V2 ON B.VisitorID = V2.VisitorID) ON A.WorkshopID = B.WorkshopIDGROUP BY V1.VisitorID, V1.Name, V2.VisitorID, V2.Name) AS visitingpairsGROUP BY访问对。访客姓名1PIVOT 访问对。访客姓名2;
我正在使用 expo 测试我的 React Native 应用程序,当使用 iPhone 进行测试时,所有按钮均无响应。它在 Android 上完全成功,其他功能在 iPhone 上也适用...
我正在使用 expo 测试我的 React Native 应用程序,当使用 iPhone 进行测试时,所有按钮均无响应。它在 Android 上完全成功,其他功能在 iPhone 上也有效。我有一个可以读取数据的扫描仪。您如何解决此问题?如果我将其部署到生产中,这个问题还会继续存在吗?
这是我的 App.js 文件。
// App.js
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import BarcodeScannerScreen from './BarcodeScanner.js';
import ProfileScreen from "./views/ProfileScreen"
import BathroomSelectionScreen from "./views/InClubScreens/BathroomSelectionScreen.js"
import ClubDetails from "./views/ClubSelectionScreens/ClubDetails.js"
import ClubMain from "./views/ClubSelectionScreens/ClubMain.js"
import BarSelection from './views/DrinkSelectionScreens/BarSelection.js'
import DrinkMenu from './views/DrinkSelectionScreens/DrinkMenu.js'
import DrinkSelection from './views/DrinkSelectionScreens/DrinkSelection.js'
import BathroomList from "./views/InClubScreens/BathroomList.js"
import Checkout from './views/DrinkSelectionScreens/Checkout.js'
import { MyProvider } from './store/context';
import { StripeProvider } from '@stripe/stripe-react-native';
import { SafeAreaView, StyleSheet } from 'react-native';
const Stack = createStackNavigator();
export default function App() {
return (
<SafeAreaView style={styles.container}>
<StripeProvider
publishableKey="pk_test_51LlDznHYav5iWqq6j2SnnvtwAZXvha9jZERJeilcJeRtpFoZ6eu21ZjiTGun7vvstGLaWsL4FwpsoQ1X25MXxM4W00dzk1zCx9"
//urlScheme="your-url-scheme" // required for 3D Secure and bank redirects
//merchantIdentifier="merchant.com.{{YOUR_APP_NAME}}" // required for Apple Pay
>
<MyProvider>
<NavigationContainer>
<Stack.Navigator initialRouteName="Scanner">
<Stack.Screen name="Scanner" options= {{headerShown:false}} component={BarcodeScannerScreen} />
<Stack.Screen options={{
headerStyle: {
backgroundColor: '#4F47C7',
},
headerTitleStyle: {
fontWeight: 'bold',
},
}} headerStyle name="Profile Creation" component={ProfileScreen}/>
<Stack.Screen name="Bathroom Selection" component={BathroomSelectionScreen} />
<Stack.Screen name="Club Details" component={ClubDetails} options={{
title: '',
}} />
<Stack.Screen name="Club Main" component={ClubMain} options={({ route }) => ({ title: route.params.name })} />
<Stack.Screen name="Bar Selection" component={BarSelection} />
<Stack.Screen name="Drink Menu" component={DrinkMenu} />
<Stack.Screen name="Checkout" component={Checkout} />
<Stack.Screen name="Drink Selection" component={DrinkSelection}
options= {{headerShown:false}}/>
<Stack.Screen name="Bathroom List" component={BathroomList} />
</Stack.Navigator>
</NavigationContainer>
</MyProvider>
</StripeProvider>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container:{
flex:1,
justifyContent:'center',
}
})
这是登陆屏幕的代码。扫描仪功能可以工作,并且可以导航,但 onPress 在 Iphone 上不起作用。在 android 上可以成功运行
// screens/HomeScreen.js
import React, { useState, useContext, useEffect } from 'react';
import { View, TextInput, Button, Text, StyleSheet, TouchableOpacity, Dimensions } from 'react-native';
import { BarCodeScanner } from 'expo-barcode-scanner';
import { useNavigation } from '@react-navigation/native';
import { MyContext,MyProvider } from './store/context';
import Ionicons from '@expo/vector-icons/Ionicons';
import service from './api/customer'
import { Alert } from "react-native";
export default function HomeScreen() {
const [hasPermission, setHasPermission] = useState(null);
const {state, clear,load} = useContext(MyContext);
const [scanned, setScanned] = useState(false);
const [inputCode, setInputCode] = useState('');
const navigation = useNavigation();
useEffect(() => {
(async () => {
const { status } = await BarCodeScanner.requestPermissionsAsync();
setHasPermission(status === 'granted');
})();
}, []);
const handleBarCodeScanned = ({ type, data }) => {
setScanned(true);
console.log(data)
service.getVenueInfo(data)
// You can perform additional checks on the barcode data if needed
.then(jsonData => {
console.log(jsonData)
if(jsonData.data.venue){ //jsonData.action.payload.data.venue
load(jsonData)
navigation.navigate('Club Main', { name: state.venue.venue_name })
}
else{
setScanned(false);
}
})
.catch(error => {console.log(error)
setScanned(false);
});
//navigation.navigate('Club Main', { barcodeData: data });
};
const handleInputChange = (text) => {
setInputCode(text);
};
const handleTextInputSubmit = () => {
// You can perform additional checks on the input code if needed
navigation.navigate('Result', { barcodeData: inputCode });
};
return (
<View style={styles.container}>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={StyleSheet.absoluteFillObject}
/>
<View style={styles.box}>
<View style={[styles.corner, styles.topLeft]} />
<View style={[styles.corner, styles.topRight]} />
<View style={[styles.corner, styles.bottomLeft]} />
<View style={[styles.corner, styles.bottomRight]} />
</View>
<TouchableOpacity style={styles.actionButton} onPress={() => navigation.goBack()}>
<Ionicons name="document-text" onPress={()=>{Alert.alert('Ive been pressed')}} size={32} color="white" />
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
actionButton: {
position: 'absolute',
bottom: 40, // Adjust this value to set the distance from the bottom
right: 40, // Adjust this value to set the distance from the right
width: 60,
height: 60,
borderRadius: 30, // Half of the width and height to make it circular
backgroundColor: '#4F47C7', // Your desired background color
justifyContent: 'center',
alignItems: 'center',
elevation: 5, // Add elevation for a slight shadow effect (Android)
shadowColor: '#000', // Shadow color (iOS)
shadowOffset: { width: 0, height: 2 }, // Shadow offset (iOS)
shadowOpacity: 0.8, // Shadow opacity (iOS)
shadowRadius: 3, // Shadow radius (iOS)
},
scanner: {
width: 300,
height: 300,
marginTop: 20,
},
input: {
borderWidth: 1,
borderColor: 'gray',
borderRadius: 5,
width: 200,
height: 40,
marginTop: 20,
padding: 8,
},
overlay: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
borderWidth: 2,
borderColor: 'white',
},
box: {
position: 'absolute',
justifyContent:'center',
width: Dimensions.get('window').width * 0.6,
height: Dimensions.get('window').height * 0.3,
top: (Dimensions.get('window').height * 0.6 - Dimensions.get('window').height * 0.081) / 2,
left: (Dimensions.get('window').width - Dimensions.get('window').width * 0.6) / 2,
},
corner: {
position: 'absolute',
width: 25,
height: 25,
borderWidth: 6,
borderColor: 'white',
},
topLeft: {
top: 0,
left: 0,
borderRightWidth: 0,
borderBottomWidth: 0,
},
topRight: {
top: 0,
right: 0,
borderLeftWidth: 0,
borderBottomWidth: 0,
},
bottomLeft: {
bottom: 0,
left: 0,
borderRightWidth: 0,
borderTopWidth: 0,
},
bottomRight: {
bottom: 0,
right: 0,
borderLeftWidth: 0,
borderTopWidth: 0,
}
});
如果有帮助的话我也可以添加配置文件